During a particular day, I have data from multiple categories say A,B,C. I want to create a bar chart in which for every day there is a single bar with different colors for the different categories. The count of categories should be stacked in a single bar for a particular day. I am not able to figure that out in Grafana. Can someone please help me out?
As I understood it he needs help with how to write the sql query to support his use case and that’s why I did think you’re answer was a bit out of scope - but you’re right it shows how to configure the graph panel to display according to his use case.
@adsingh A query like this should be able to solve it:
SELECT
$__timeGroup(<your time column>, '24h') as time,
<category column> as metric,
count(<id column?>)
FROM
<table>
WHERE
$__timeFilter(<your time column>)
GROUP BY
$__timeGroup(<your time column>, '24h'),
<category column>
ORDER BY 1
@mefraimsson Do you know how to get rid of the time data on the X-axis of the graph? I have this at the moment and I’d like to only see the date of the day, such as 4/1 instead of having a time next to it.