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:
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.
Thanks, this helped me to get started with the same issue, but I found another solution based on the latest Grafana (9.3.2) without changing the global config, just for reference.
With the data in place I used Override function to reformat the Y axis to days:
Override fields with Name = Time
Standard options > Unit = time:dddd (needed to copy paste this as auto completion would kill it otherwise)