Min max values for the displayed time range

Dear Grafana experts,
I’ve created a dashboard that uses mysql as source. working beautifully. temperature data is displayed.
the default time range is set to 3 days.
min/max and current values are displayed under the graph.

my problem is that no matter what the time range is, the min/max values are always show the min/max for the whole database from beginning of time.

is there an option to change this and when I choose last 3 days, then it shows min/max for that 3 days only?
thanks
Gergo

Does your query have a time filter?

There is a MySQL query macro you can use in your query, $__timeFilter(dateColumn)

Torkel,
thank you for your quick reply! this is my query:

SELECT
  datetime as time_sec,
  temp as value,
  metric as metric
FROM temp
where metric in ('pince', 'nappali', 'kinti')
and temp < 60

could you please advise where to put the

$__timeFilter(dateColumn)

code and how exactly?
thanks again
Gergo

Here is an example of a query that uses $__timeFilter:

http://docs.grafana.org/features/datasources/mysql/#table-queries