ambaetzgi
Posts: 19
Joined: Tue Feb 22, 2022 7:52 am

2 Values on one x in tooltip

I have the following values (example)
1. value is date
2. value is minutes
3. value is temperature.
i display the 1st and 2nd value in a scatter. but i want to display the 3rd value in tooltip.
How do I have to do that?
my simple solution with data: Data50_2.map(([x, y, z]) => [new Date(x).getTime(), y, z]), and {point.z} does not work,
At https://jsfiddle.net/8c7kpht0/ is the example.
Thanks for the help
hubert.k
Posts: 1164
Joined: Mon Apr 11, 2022 11:48 am

Re: 2 Values on one x in tooltip

Hello ambaetzgi!
Thanks for contacting us with your question!

You have two ways to achieve that feature.
1) You can set data point as an object with named properties. More info here: https://api.highcharts.com/highcharts/s ... atter.data

Code: Select all

data: [{
    x: 1,
    y: 2,
    z: 17
}, {
    x: 1,
    y: 4,
    z: 15
}]
2) or set data as an array of arrays - as you do now, but with using a series.keys property to define the way to decode your new format set keys. Check it in the demo below.

Demo: https://jsfiddle.net/BlackLabel/yd0gekw6/
API Reference: https://api.highcharts.com/highcharts/s ... atter.keys

Let me know if you have any further questions.
Kind regards!
Hubert Kozik
Highcharts Developer

Return to “Highcharts Usage”