How to rewrite/modify the time-labels on the x-axis of a bar chart?

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

Grafana 9.2
Ubuntu 20.04

  • What are you trying to achieve?

I have a bar chart that currently looks like this:

I would like to overwrite the time-label on the x-axis, so that they are of format DD.MM..
I am unable to figure out how to do this.

This is the query that is used to obtain the plot data:

SELECT SUM("difference") 
FROM (
    SELECT DIFFERENCE(MAX("aenergy_total")) AS "difference"
    FROM "pm_shelly"
    WHERE time > now() - 6d 
      AND custom_id =~ /^shelly_112|shelly_113|shelly_114$/
    GROUP BY time(1d), "custom_id" 
    tz('Europe/Zurich')
) 
GROUP BY time(1d) 
tz('Europe/Zurich')

Hi,

Would something like overriding Time field work in your case? Just add override for fields with your time and check if it works (worked for me, although Prometheus datasource).

Thank you for commenting. I was able to make it work with your input.
I also found this post, which essentially explains the same thing: Change dashboard date format - #4 by ldrascic