Change x-as and value to day or month calculation


Since this weekend I’ve installed InfluxDb and Grafana, which are using data from Domoticz.

My question is about a graph for gas usage. The data I get is every hour the gas meter value.
In the normal graph for the last 24 hours I use diff() to see the difference between 2 values to know the usage for that hour.

I now want to move the graph to a Montly view were I summarize the hourly value of a day to a total for that day during the month.
Example: yesterday the gas usage was about 0,5m3 per hour, so the total of that day would be 6m3 to be displayed in the Monthly view.

Same story of course for a Graph per year, where you want to display the totals of a month.

In other post I read something like summarize or sum().
The sum() does not work in combination with the diff() function. When I remove the diff() the it takes the sum of the gas meter values.
With the summarize function I doubt if it works with InFlux.

Does anybody have any advice?


Raw data without diff()

Raw data with diff() so the usage of that hour is correctly shown

And the query of course

Hi Jeroen, I am pretty new to Grafana but have some nice graphs working now, that gas usage, I also want to see gas usage per hour. Now I only get the total meter status… I read you used a diff() setting to calculate the difference gas use from last hour with the previous… where can I find that setting? in the query? but where and how? can you please show that? thanks, Ger