- What Grafana version and what operating system are you using?
Grafana v10.3.1 (00a22ff8b2) - Windows 11 - What are you trying to achieve?
I have a database (In MySQL) having data like this:
*|Name | TS | Value|
|— | — | —|
|T1000 | 2025-04-05 08:00:00 | 50|
|T1000 | 2025-04-05 08:01:00 | 55|
|… | … | …|
|T1000 | 2025-04-05 09:41:00 | 70|
| | | |
| | | |
So every minute I receive new data for a specific Name, for example T1000, but there are many more also coming every minute. My basic approach in Grafana to plot this over a time series is using that code:
SELECT
$__timeGroup(ts,$__interval) as [time],
avg(value),
Name as Metric
FROM [myTable]with(nolock)
where $__timeFilter(ts)
group by $__timeGroup(ts,$__interval), Name
ORDER BY [time] asc
leading to that result (which is exactly what I need for a different case)
- What did you expect to happen?
I want to have this data now shown as daily aggregated values, best shown via a bar-plot. I have looked all over the place but I can’t seem to find a working solution for that. I tried to change $__timeGroup(ts,$__interval) to
$__timeGroup(ts, ‘1d’) but that doesn’t to it, because my x-Axis is doing strange things then.
The solution is probably easy but I can’t find a good one ^^, maybe someone can help me.
kind regards