Vertical Bar Charts Hide Null Values

  • What Grafana version and what operating system are you using?
    Grafana v11.1.4

  • What are you trying to achieve?
    Vertical Bar Chart

  • How are you trying to achieve it?
    By running SQL query with backend as Postgres

  • What happened?
    The query is NOT returning any null values when directly executed in a query editor but Grafana returns null values in the array list. This is resulting in 0 bars for few values.

  • What did you expect to happen?
    The 0 bars should not be visible and only ones with values should be displayed.


you could use a transformation to filter data by values, and exclude the nulls

The values(count(username) are not limited. Everyday there can be new users who can be created. So, can’t use transformation.
The horizontal bars are working as expected. It is only the vertical bars that I am facing issues with.

can you share your postgres query?

select m.punch_time::timestamp::date as time, u.email, count(u.email)
FROM
punch m
JOIN
users u ON u.id = m.user_id
WHERE
punch_time between ‘${__from:date:iso}’ AND ‘${__to:date:iso}’
group by m.punch_time::timestamp::date, u.email;

can you share a table view export of your query result?