Bar chart Energy consumption per day with graphite


I’m trying to plot a bar chart which display energy consumption per day, for the last 7 days, for example. Should look like this:

I have a series which holds the total energy consumption and from that i have to calculate the consumption the last 24 hours, thats how far i’ve gotten, but how do i do that for the last x days?

I am using graphite as my data source!
Help would be very appreciated,

what is your query for calculating the last day of energy consumption? It sounds like you might be able t template that query using template variables. then you choose the number of days from a select dropdown

Here are the docs on template variables. And here is a list of good examples on that use template variables. You can inspect each dashboard to see just how the variables are constructed.

See the solution here:

1 Like