I would like to know how I can make a bar graph for the daily consumption for every meter. What I want is days on the x-axis, a bar for every meter id side by side for every day.
The data is stored every second, but has a field for the daily running consumed amount, so a selection for the last or max daily value should work.
The query looks like this:
SELECT last(“Energy_Wh”) FROM “Ac/Loads” WHERE (“Id” != ‘Total’) AND $timeFilter GROUP BY time(24h),“Id” ORDER BY time ASC
I’m trying but I can’t make such bar with either “Time series”, “Graph (old)” or “Bar chart”.
Besides the last() you also need to capture the time for last and the resding type in order to get what you want
Select last() as value,
firstdayof(datetime) as time,
Id as metric
I think it is firstdayof that converts datetime to date.
Kind of thing. And then on the bar chart make sure to use the datetime value as the axis value
I’m sorry but I think you are referring to another DB provider. Could that be Influxdbv2?
I can’t select time or any tag in the field region. That would be handy though.
No this was just in general as a principle, data source agnostic.
What data source do you have?
1 Like
I am using InfluxDBv1 in that case
Surely there must be a time column in v1? Its a time series db
What version of grafana are you on
Grafana v8.3.3 (30bb7a93ca)