How to show column/row headers even when there is no data/data is null

I saw a previous topic with no answer to this.

I have a dashboard table with multiple columns and rows. However, when there is no data available for a certain column/row, the header disappears and doesnt show. Is there an option to allow for all headers to show at all time?

2 Likes

Welcome

What is your datasource and could you please provide sample data

1 Like

Is there any update on this issue? I was wondering the same thing. I have a psql query that returns no data and in this case the table header is missing.

1 Like

Did you ever find an answer to this? I am running into a similar issue, where I have made a heatmap using a table, but the days dissapear when there is no hour data, and the VP’s are demanding the days always show…even though, it logically makes sense as to why they are gone.

I attempted to do a subquery like so, but it failed, as I do not think Grafana can handle something like this…and I cannot add dummy data to the source mariadb.

CREATE TEMPORARY TABLE HelperTable AS
(
SELECT ‘Sunday’ AS day_name, 1 AS day_of_week, 0 AS hour
UNION ALL SELECT ‘Sunday’, 1, 1
UNION ALL SELECT ‘Sunday’, 1, 2
UNION ALL SELECT ‘Sunday’, 1, 3
UNION ALL SELECT ‘Sunday’, 1, 4
UNION ALL SELECT ‘Sunday’, 1, 5
UNION ALL SELECT ‘Sunday’, 1, 6
UNION ALL SELECT ‘Sunday’, 1, 7
UNION ALL SELECT ‘Sunday’, 1, 8
UNION ALL SELECT ‘Sunday’, 1, 9
UNION ALL SELECT ‘Sunday’, 1, 10
UNION ALL SELECT ‘Sunday’, 1, 11
UNION ALL SELECT ‘Sunday’, 1, 12
UNION ALL SELECT ‘Sunday’, 1, 13
UNION ALL SELECT ‘Sunday’, 1, 14
UNION ALL SELECT ‘Sunday’, 1, 15
UNION ALL SELECT ‘Sunday’, 1, 16
UNION ALL SELECT ‘Sunday’, 1, 17
UNION ALL SELECT ‘Sunday’, 1, 18
UNION ALL SELECT ‘Sunday’, 1, 19
UNION ALL SELECT ‘Sunday’, 1, 20
UNION ALL SELECT ‘Sunday’, 1, 21
UNION ALL SELECT ‘Sunday’, 1, 22
UNION ALL SELECT ‘Sunday’, 1, 23
)
UNION ALL
(
SELECT ‘Monday’ AS day_name, 2 AS day_of_week, 0 AS hour
UNION ALL SELECT ‘Monday’, 2, 1
UNION ALL SELECT ‘Monday’, 2, 2
UNION ALL SELECT ‘Monday’, 2, 3
UNION ALL SELECT ‘Monday’, 2, 4
UNION ALL SELECT ‘Monday’, 2, 5
UNION ALL SELECT ‘Monday’, 2, 6
UNION ALL SELECT ‘Monday’, 2, 7
UNION ALL SELECT ‘Monday’, 2, 8
UNION ALL SELECT ‘Monday’, 2, 9
UNION ALL SELECT ‘Monday’, 2, 10
UNION ALL SELECT ‘Monday’, 2, 11
UNION ALL SELECT ‘Monday’, 2, 12
UNION ALL SELECT ‘Monday’, 2, 13
UNION ALL SELECT ‘Monday’, 2, 14
UNION ALL SELECT ‘Monday’, 2, 15
UNION ALL SELECT ‘Monday’, 2, 16
UNION ALL SELECT ‘Monday’, 2, 17
UNION ALL SELECT ‘Monday’, 2, 18
UNION ALL SELECT ‘Monday’, 2, 19
UNION ALL SELECT ‘Monday’, 2, 20
UNION ALL SELECT ‘Monday’, 2, 21
UNION ALL SELECT ‘Monday’, 2, 22
UNION ALL SELECT ‘Monday’, 2, 23
)
UNION ALL
(
SELECT ‘Tuesday’ AS day_name, 2 AS day_of_week, 0 AS hour
UNION ALL SELECT ‘Tuesday’, 3, 1
UNION ALL SELECT ‘Tuesday’, 3, 2
UNION ALL SELECT ‘Tuesday’, 3, 3
UNION ALL SELECT ‘Tuesday’, 3, 4
UNION ALL SELECT ‘Tuesday’, 3, 5
UNION ALL SELECT ‘Tuesday’, 3, 6
UNION ALL SELECT ‘Tuesday’, 3, 7
UNION ALL SELECT ‘Tuesday’, 3, 8
UNION ALL SELECT ‘Tuesday’, 3, 9
UNION ALL SELECT ‘Tuesday’, 3, 10
UNION ALL SELECT ‘Tuesday’, 3, 11
UNION ALL SELECT ‘Tuesday’, 3, 12
UNION ALL SELECT ‘Tuesday’, 3, 13
UNION ALL SELECT ‘Tuesday’, 3, 14
UNION ALL SELECT ‘Tuesday’, 3, 15
UNION ALL SELECT ‘Tuesday’, 3, 16
UNION ALL SELECT ‘Tuesday’, 3, 17
UNION ALL SELECT ‘Tuesday’, 3, 18
UNION ALL SELECT ‘Tuesday’, 3, 19
UNION ALL SELECT ‘Tuesday’, 3, 20
UNION ALL SELECT ‘Tuesday’, 3, 21
UNION ALL SELECT ‘Tuesday’, 3, 22
UNION ALL SELECT ‘Tuesday’, 3, 23
)
UNION ALL
(
SELECT ‘Wednesday’ AS day_name, 2 AS day_of_week, 0 AS hour
UNION ALL SELECT ‘Wednesday’, 4, 1
UNION ALL SELECT ‘Wednesday’, 4, 2
UNION ALL SELECT ‘Wednesday’, 4, 3
UNION ALL SELECT ‘Wednesday’, 4, 4
UNION ALL SELECT ‘Wednesday’, 4, 5
UNION ALL SELECT ‘Wednesday’, 4, 6
UNION ALL SELECT ‘Wednesday’, 4, 7
UNION ALL SELECT ‘Wednesday’, 4, 8
UNION ALL SELECT ‘Wednesday’, 4, 9
UNION ALL SELECT ‘Wednesday’, 4, 10
UNION ALL SELECT ‘Wednesday’, 4, 11
UNION ALL SELECT ‘Wednesday’, 4, 12
UNION ALL SELECT ‘Wednesday’, 4, 13
UNION ALL SELECT ‘Wednesday’, 4, 14
UNION ALL SELECT ‘Wednesday’, 4, 15
UNION ALL SELECT ‘Wednesday’, 4, 16
UNION ALL SELECT ‘Wednesday’, 4, 17
UNION ALL SELECT ‘Wednesday’, 4, 18
UNION ALL SELECT ‘Wednesday’, 4, 19
UNION ALL SELECT ‘Wednesday’, 4, 20
UNION ALL SELECT ‘Wednesday’, 4, 21
UNION ALL SELECT ‘Wednesday’, 4, 22
UNION ALL SELECT ‘Wednesday’, 4, 23
)
UNION ALL
(
SELECT ‘Thursday’ AS day_name, 2 AS day_of_week, 0 AS hour
UNION ALL SELECT ‘Thursday’, 5, 1
UNION ALL SELECT ‘Thursday’, 5, 2
UNION ALL SELECT ‘Thursday’, 5, 3
UNION ALL SELECT ‘Thursday’, 5, 4
UNION ALL SELECT ‘Thursday’, 5, 5
UNION ALL SELECT ‘Thursday’, 5, 6
UNION ALL SELECT ‘Thursday’, 5, 7
UNION ALL SELECT ‘Thursday’, 5, 8
UNION ALL SELECT ‘Thursday’, 5, 9
UNION ALL SELECT ‘Thursday’, 5, 10
UNION ALL SELECT ‘Thursday’, 5, 11
UNION ALL SELECT ‘Thursday’, 5, 12
UNION ALL SELECT ‘Thursday’, 5, 13
UNION ALL SELECT ‘Thursday’, 5, 14
UNION ALL SELECT ‘Thursday’, 5, 15
UNION ALL SELECT ‘Thursday’, 5, 16
UNION ALL SELECT ‘Thursday’, 5, 17
UNION ALL SELECT ‘Thursday’, 5, 18
UNION ALL SELECT ‘Thursday’, 5, 19
UNION ALL SELECT ‘Thursday’, 5, 20
UNION ALL SELECT ‘Thursday’, 5, 21
UNION ALL SELECT ‘Thursday’, 5, 22
UNION ALL SELECT ‘Thursday’, 5, 23
)
UNION ALL
(
SELECT ‘Friday’ AS day_name, 2 AS day_of_week, 0 AS hour
UNION ALL SELECT ‘Friday’, 6, 1
UNION ALL SELECT ‘Friday’, 6, 2
UNION ALL SELECT ‘Friday’, 6, 3
UNION ALL SELECT ‘Friday’, 6, 4
UNION ALL SELECT ‘Friday’, 6, 5
UNION ALL SELECT ‘Friday’, 6, 6
UNION ALL SELECT ‘Friday’, 6, 7
UNION ALL SELECT ‘Friday’, 6, 8
UNION ALL SELECT ‘Friday’, 6, 9
UNION ALL SELECT ‘Friday’, 6, 10
UNION ALL SELECT ‘Friday’, 6, 11
UNION ALL SELECT ‘Friday’, 6, 12
UNION ALL SELECT ‘Friday’, 6, 13
UNION ALL SELECT ‘Friday’, 6, 14
UNION ALL SELECT ‘Friday’, 6, 15
UNION ALL SELECT ‘Friday’, 6, 16
UNION ALL SELECT ‘Friday’, 6, 17
UNION ALL SELECT ‘Friday’, 6, 18
UNION ALL SELECT ‘Friday’, 6, 19
UNION ALL SELECT ‘Friday’, 6, 20
UNION ALL SELECT ‘Friday’, 6, 21
UNION ALL SELECT ‘Friday’, 6, 22
UNION ALL SELECT ‘Friday’, 6, 23
)
UNION ALL
(
SELECT ‘Saturday’ AS day_name, 2 AS day_of_week, 0 AS hour
UNION ALL SELECT ‘Saturday’, 7, 1
UNION ALL SELECT ‘Saturday’, 7, 2
UNION ALL SELECT ‘Saturday’, 7, 3
UNION ALL SELECT ‘Saturday’, 7, 4
UNION ALL SELECT ‘Saturday’, 7, 5
UNION ALL SELECT ‘Saturday’, 7, 6
UNION ALL SELECT ‘Saturday’, 7, 7
UNION ALL SELECT ‘Saturday’, 7, 8
UNION ALL SELECT ‘Saturday’, 7, 9
UNION ALL SELECT ‘Saturday’, 7, 10
UNION ALL SELECT ‘Saturday’, 7, 11
UNION ALL SELECT ‘Saturday’, 7, 12
UNION ALL SELECT ‘Saturday’, 7, 13
UNION ALL SELECT ‘Saturday’, 7, 14
UNION ALL SELECT ‘Saturday’, 7, 15
UNION ALL SELECT ‘Saturday’, 7, 16
UNION ALL SELECT ‘Saturday’, 7, 17
UNION ALL SELECT ‘Saturday’, 7, 18
UNION ALL SELECT ‘Saturday’, 7, 19
UNION ALL SELECT ‘Saturday’, 7, 20
UNION ALL SELECT ‘Saturday’, 7, 21
UNION ALL SELECT ‘Saturday’, 7, 22
UNION ALL SELECT ‘Saturday’, 7, 23
)

How about taking this baby for a spin

or I would say fork the heatmap plugin and fix it there

I wish we could use that, unfortunatly, we cannot install plugins in our Grafana instance :frowning:

Why? Tell them VPs asked for it :smile: In that case fork and fix that heatmap plugin :eyes:

1 Like

Try a left join from a dynamic calendar table to your main data table. Then you will have days with no hour data instead of missing days

You can build your dynamic calendsr dates based on your _from and _to dates as a cte or temp table
We have a persisted calendar table that is refreshed continously with good indices.

Also use a stored procedure instead of inline query.

Hope they allow stored procedures

Hi Team,

Even i am looking for help here. Whenever i am using influx query, If there is no data in the measurement. Expected column in getting disappeared. Do we have any way to get the column headers even if there is no value in the measurement.

While it was made with MariaDB and not Influx, it may still give some insight.

HeatMap by Day’s and hours (not date) - Grafana / Dashboards - Grafana Labs Community Forums