Display Graph Relative to Zero


#1

Hello I have a graph with the KWh consumption, this data is from a influxdb, and I’m using Grafana 5.4.2. This is the data (right axis)

I would like the graph to start on the zero, according to the rage selected. I tried

SELECT min("kwh") - "kwh" FROM "power" WHERE ("deviceId" = 'main') AND $timeFilter GROUP BY time($__interval);

No luck!!!

Also I would like to create a bar graph that would show me the daily kwh consumption. I can’t seem to find a way to do this!

SELECT max("kwh") - min("kwh") FROM ( SELECT "kwh"  FROM "power" WHERE $timeFilter )  GROUP BY time("1d")

No luck!

Can any one help me? Is this possible with the data that I have in the DB?

thank you


#2

Ok, I solved the second one! :slight_smile:

SELECT max - min FROM ( SELECT min("kwh") , max("kwh") FROM "power" WHERE $timeFilter GROUP BY time(1d) )

Can any one help me with the first one?

Thank You