mk.developer
Posts: 84
Joined: Wed Mar 17, 2021 6:07 pm

Show percentage value in tooltip and Y axis

I have a simple line chart.

Example: http://jsfiddle.net/mkdeveloper2021/wLbaneo7/3/

I would like to show values in percentage. Example: 0.029 should be "2.9%". Also, I would like the Y axis to show range accordingly to the value converted in the percentage.

Is there any existing formatter available that would automatically do that? (or do I need to multiply with 100 and add % suffix?)

Really appreciate if you can update the example with the suggested implementation for it.

Thanks.
dominik.c
Posts: 2081
Joined: Fri Aug 07, 2020 7:07 am

Re: Show percentage value in tooltip and Y axis

Hello mk.developer!

We appreciate you reaching out to us!

I think that we can use a basic formatter function for the tooltip and for the axis labels. In the link below you can find a demo that I've prepared for you. Check it out and tell me if it meets your expectations. :)

API references:
https://api.highcharts.com/highcharts/tooltip.formatter
https://api.highcharts.com/highcharts/yAxis.min
https://api.highcharts.com/highcharts/yAxis.max
https://api.highcharts.com/highcharts/y ... .formatter

Demo:
http://jsfiddle.net/BlackLabel/34Lurd1k/

Best regards!
Dominik Chudy
Highcharts Developer
mk.developer
Posts: 84
Joined: Wed Mar 17, 2021 6:07 pm

Re: Show percentage value in tooltip and Y axis

Perfect, thanks Dominik
dominik.c
Posts: 2081
Joined: Fri Aug 07, 2020 7:07 am

Re: Show percentage value in tooltip and Y axis

You're welcome!

In case of any further questions, feel free to contact us again.
Dominik Chudy
Highcharts Developer

Return to “Highcharts Usage”