Bar Graph Static Search

Hey Guys,

I am looking to create a couple graphs, the search is static as its showing a years worth of data. Everything I am running into Grafana is that it is built around using the time ranges.

The data that I am working with is sales data, so its a list of sales by person on a date with profit ect. Ideally I want to display a stacked bar graph showing the total profit per month. (the line is a count of orders)

So in this case the query is a static SQL query that would return the results and I just want to put that into a graph.

Is this possible with Grafana?

Hi,

Yes, should be possible with postgres and/or mysql using a special macro function for grouping the time field by month (maybe only 30 days or similar is supported). You’ll also want to group by person and the person will be the name of the series and sum of profit will be metric value.

Then you’ll want to select display mode bars and stacked mode.

See example graph.

Marcus