Default datetime formatting to weekday possible?

Dear all,

i’m monitoring my energy consumption per day, which looks like this:

I would like to display the day of the week on the x-axis like “Monday Tuesday” etc.
Is this possible?

Currently i am transforming my time to a string and chose as unit “Datetime default”

This is how my table looks:

Here are my queries and transformations:


Thanks!
Florian

The timeseries plugin is designed to use time on the x axis, and I don’t know how or even if you can aggregate many time stamps into “buckets” arranged by day of the week.

But the bar chart can use any arbitrary string on the x axis to do just this. If you could get you data to fit thaat data model, then I think this is possible

As I upgraded my Grafana from 8.3.3 to 8.4.1, it understood the timestamp without converting it to a string and then overriding the unit to DateTime.
With this change, each bar got a label like “12/02 00:01”, which already was acceptable for me.

After looking in the grafana.ini, i found out that it automatically uses the format interval_hour = MM/DD HH:mm. Sadly I did not find out, how to change the bar chart to use another format.

So i chose a not-so-elegant approach and just changed the format in the config to interval_hour = dddd which displays the week day (src: momentjs.com). Since no other graph uses this format in my dashboards, this was an OK solution.

This is the final result:

And also thanks for the hint with template variables!

Greetings,
Florian

2 Likes