Count per days (Bar gauge)

Hello!

I am trying to make bar graph of the count of events per day.

Table of data (Postgres):
Navicat Premium 2021-07-05 21-49-26

SQL query 1 (Number of events of the first category per day):
SELECT
CAST(“PP_EDO”.“Timestamp” as DATE) AS “Date”,
COUNT(“PP_EDO”.“Event”) AS “Events”
FROM
“PP_EDO”
WHERE
“PP_EDO”.“Category” = ‘1’
GROUP BY
CAST(“PP_EDO”.“Timestamp” as DATE)
Result:
Date Events
2021-06-22 3
2021-06-23 2
2021-06-24 1

SQL query 2 (Number of events of the second category per day):
SELECT
CAST(“PP_EDO”.“Timestamp” as DATE) AS “Date”,
COUNT(“PP_EDO”.“Event”) AS “Events”
FROM
“PP_EDO”
WHERE
“PP_EDO”.“Category” = ‘1’
GROUP BY
CAST(“PP_EDO”.“Timestamp” as DATE)
Result:
Date Events
2021-06-22 2
2021-06-23 2
2021-06-24 1

And I need to make bar graph (two colors per Category):

I have tried many configuration options but cannot get the correct result. I would be very grateful for your help.

Grafana version 7.4.0b (RHEL 7.6)

:roll_eyes: Maybe direction to solve problem?

This topic was automatically closed after 365 days. New replies are no longer allowed.