How can I change graph X-axis to show days of the week(Monday, Tuesday, Wednesday etc)


I wanted to change how the x-axis is displayed. Change the way the dates are displayed in dd/mm/time to just the day of the week

Hi @nivekc Try the override of the units to be time:dd ( you will have to type it in, as it is not in the list of choices).

Unfortunately, I have found it only works (for me) on tables. Maybe one of the Grafana staff can comment on if it should not work on other visualizations.

2 Likes

Thanks Grant, I’ve been playing around trying to get this to work for a fair while.

@grant2, Thank you so much for taking your time on this. I tried your solution and yes it only works when I change it to a table. But on trying to implement it on the visualization, it reverts back to the day and time format.

On changing it to time:dddd it looks like this as a table


But on switching to Bar chart visualization it produces this output

@mattabrams @samcoren or anyone at Grafana: Can anyone comment on if the day of week time format should work on other visualizations (besides Table, where it works fine)?

@grant2 @nivekc @superknight

I’ve brought this to the teams to double check, but I’m fairly sure there isn’t a way to adjust the appearance of the time on the x-axis with the time-series panel.

You can use strings on the x-axis for the bar chart, not bar gauge, so I was able to duplicate this table and, without changing anything, it worked OK for bar chart…maybe?

https://play.grafana.org/d/_ovpFVYnz/day-of-week-test?orgId=1

the tooltip in the timeseries displays the day of week, but not the x-axis.

I even tried overriding GF_DATE_FORMATS_FULL_DATE=‘DDDD HH:mm:ss’. Interestingly, that gives the day of the YEAR. This shows on the tooltip, and the date-picker, but has no impact on the x-axis in the time-series, alas…

might be a worthy feature request?

2 Likes

@mattabrams
Yes, for bar charts it works just fine. The limitation comes in the time series.
Yes, I think it might be worth a feature request. Thanks.

1 Like