I almost have a working heatmap that splits hourly occourances by day (not date). I cannot figure out how to smush the graph together so it looks as I need it too, anyone have an idea? Why is this not an option yet, why can we not declare our own xβs and yβs on all the built in charts, only controling x is so frustrating .
My time slice is selected for the last 90 days
- What Grafana version and what operating system are you using?
9.5.1
Below is the code I am using with a Status history graph.
SELECT
Created
, SUM(CASE WHEN EXTRACT(HOUR FROM created) = β0β THEN 1 ELSE 0 END) AS β00:00β
, SUM(CASE WHEN EXTRACT(HOUR FROM created) = β1β THEN 1 ELSE 0 END) AS β01:00β
, SUM(CASE WHEN EXTRACT(HOUR FROM created) = β2β THEN 1 ELSE 0 END) AS β02:00β
, SUM(CASE WHEN EXTRACT(HOUR FROM created) = β3β THEN 1 ELSE 0 END) AS β03:00β
, SUM(CASE WHEN EXTRACT(HOUR FROM created) = β4β THEN 1 ELSE 0 END) AS β04:00β
, SUM(CASE WHEN EXTRACT(HOUR FROM created) = β5β THEN 1 ELSE 0 END) AS β05:00β
, SUM(CASE WHEN EXTRACT(HOUR FROM created) = β6β THEN 1 ELSE 0 END) AS β06:00β
, SUM(CASE WHEN EXTRACT(HOUR FROM created) = β7β THEN 1 ELSE 0 END) AS β07:00β
, SUM(CASE WHEN EXTRACT(HOUR FROM created) = β8β THEN 1 ELSE 0 END) AS β08:00β
, SUM(CASE WHEN EXTRACT(HOUR FROM created) = β9β THEN 1 ELSE 0 END) AS β09:00β
, SUM(CASE WHEN EXTRACT(HOUR FROM created) = β10β THEN 1 ELSE 0 END) AS β10:00β
, SUM(CASE WHEN EXTRACT(HOUR FROM created) = β11β THEN 1 ELSE 0 END) AS β11:00β
, SUM(CASE WHEN EXTRACT(HOUR FROM created) = β12β THEN 1 ELSE 0 END) AS β12:00β
, SUM(CASE WHEN EXTRACT(HOUR FROM created) = β13β THEN 1 ELSE 0 END) AS β13:00β
, SUM(CASE WHEN EXTRACT(HOUR FROM created) = β14β THEN 1 ELSE 0 END) AS β14:00β
, SUM(CASE WHEN EXTRACT(HOUR FROM created) = β15β THEN 1 ELSE 0 END) AS β15:00β
, SUM(CASE WHEN EXTRACT(HOUR FROM created) = β16β THEN 1 ELSE 0 END) AS β16:00β
, SUM(CASE WHEN EXTRACT(HOUR FROM created) = β17β THEN 1 ELSE 0 END) AS β17:00β
, SUM(CASE WHEN EXTRACT(HOUR FROM created) = β18β THEN 1 ELSE 0 END) AS β18:00β
, SUM(CASE WHEN EXTRACT(HOUR FROM created) = β19β THEN 1 ELSE 0 END) AS β19:00β
, SUM(CASE WHEN EXTRACT(HOUR FROM created) = β20β THEN 1 ELSE 0 END) AS β20:00β
, SUM(CASE WHEN EXTRACT(HOUR FROM created) = β21β THEN 1 ELSE 0 END) AS β21:00β
, SUM(CASE WHEN EXTRACT(HOUR FROM created) = β22β THEN 1 ELSE 0 END) AS β22:00β
, SUM(CASE WHEN EXTRACT(HOUR FROM created) = β23β THEN 1 ELSE 0 END) AS β23:00β
, CASE DAYOFWEEK(created)
WHEN 1 THEN βSundayβ
WHEN 2 THEN βMondayβ
WHEN 3 THEN βTuesdayβ
WHEN 4 THEN βWednesdayβ
WHEN 5 THEN βThursdayβ
WHEN 6 THEN βFridayβ
WHEN 7 THEN βSaturdayβ
END AS day
FROM table
WHERE TenantId = β${TenantId}β
AND $__timeFilter(Created)
Group BY DAYOFWEEK(Created)