How to format and display times in a bar chart? #4989
-
I have a series of times associated with a set of items, and I want to display that in a stacked bar chart. Each time is n minutes, but I want to display the axes and the tooltips as hours+minutes. So "67" should be "01:07". |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments
-
Hello! |
Beta Was this translation helpful? Give feedback.
-
To be clear (and for anyone else searching for an answer), I ended up with a formatter with the following in it: |
Beta Was this translation helpful? Give feedback.
Hello!
I believe formatter functions are the best path for this. I use them both in
options.xaxis.labels.formatter
andoptions.yaxis.labels.formatter
.Considering your case, testing it for Xaxis should be very straightforward, and for Yaxis if it fails to show you might need to use some array in settings, like for defining different formatter functions for each series.