robsimpson
Posts: 1
Joined: Fri Sep 23, 2022 5:37 am

How to add series data to a tooltip

I can't find an example of this in the documentation. How can I add additional data to the tooltip on hovering on a series?

I have a series with x and y values - how can I add a value z to display on hover?

Thanks.
hubert.k
Posts: 1164
Joined: Mon Apr 11, 2022 11:48 am

Re: How to add series data to a tooltip

Hi robsimpson!
Welcome to our forum and thanks for contacting us with your question!

You can do it a few ways. You can use tooltip.pointFormat property and set a proper variable.
Demo: https://jsfiddle.net/BlackLabel/z2718Lah/
API Reference: https://api.highcharts.com/highcharts/t ... ointFormat

Or you can use tooltip.formatter property and return a proper string. This is used to more complicated stuff or if you want to show some HTML element in the tooltip.
Demo: https://jsfiddle.net/BlackLabel/638yzLx5/
API Reference: https://api.highcharts.com/highcharts/tooltip.formatter

Feel free to ask any further questions.
Regards!
Hubert Kozik
Highcharts Developer

Return to “Highcharts Usage”