eneeio-nm
Posts: 2
Joined: Fri Feb 23, 2024 9:39 am

Column chart with hours and minutes displayed on yAxis instead of minutes

Hey there.

I'm attempting to create a column chart that displays data (timestamp and minutes) on the yAxis where minutes are displayed as hours and minutes.

I've been able to do this in the tooltip (thanks to other examples I've found in this useful forum. However, I'm stumped on the main purpose of this data display.

Here's my Codepen containing where I've got to: https://codepen.io/eneeio-nm/pen/KKELYgJ

Any help will be greatly appreciated.
jedrzej.r
Posts: 725
Joined: Tue Jan 24, 2023 11:21 am

Re: Column chart with hours and minutes displayed on yAxis instead of minutes

Hi!

Welcome to our forum and thanks for getting in touch with us!

In order to make the labels on y-axis display hours and minutes, like in the tooltip, you can utilize the method for converting the value to a desired output and use it inside the yAxis.labels.format string template. It is recommended to use format string templating whenewer possible, as it is compatible with JSON formating and is safer to use.

Demo: https://codepen.io/Jdrzej-Ruta/pen/xxB ... itors=0010

References:
https://www.highcharts.com/docs/chart-c ... templating
https://api.highcharts.com/highcharts/y ... els.format
https://api.highcharts.com/highcharts/t ... ointFormat

Let me know if that's what you were looking for.
Best regards!
Jędrzej Ruta
Highcharts Developer
eneeio-nm
Posts: 2
Joined: Fri Feb 23, 2024 9:39 am

Re: Column chart with hours and minutes displayed on yAxis instead of minutes

Awesome, thanks for the prompt response Jędrzej 🙏
jedrzej.r
Posts: 725
Joined: Tue Jan 24, 2023 11:21 am

Re: Column chart with hours and minutes displayed on yAxis instead of minutes

You're welcome!

In case of any other questions related to Highcharts, feel free to ask anytime.
Best regards!
Jędrzej Ruta
Highcharts Developer

Return to “Highcharts Usage”