ReloadOK
Posts: 2
Joined: Wed Jun 15, 2022 11:29 am

Displaying additional data in tooltip

Utilizing this chart code, I'm having trouble grabbing the third [2] and fourth [3] options in the array of a point to display in the tooltip.

Code: Select all

[
  [
    1147651200000,
    23.15,
    "1,425.00",
    "120"
  ],
  [
    1147737600000,
    23.01,
    "1,999.00",
    "150"
  ]
]
kamil.m
Posts: 892
Joined: Thu May 19, 2022 1:33 pm

Re: Displaying additional data in tooltip

Hi there,

Welcome to our forum and thank you for contacting us with your question!

You can access all of the point properties (from points array) through this keyword in a tooltip.formatter.
Please take a look at the Highcharts Stock API reference.
API Reference: https://api.highcharts.com/highstock/tooltip.formatter

​If you have further inquiries, you may reach out to us at any time
Best regards!
Kamil Musiałowski
Highcharts Developer
ReloadOK
Posts: 2
Joined: Wed Jun 15, 2022 11:29 am

Re: Displaying additional data in tooltip

kamil.m wrote: Wed Jun 15, 2022 12:31 pm Hi there,

Welcome to our forum and thank you for contacting us with your question!

You can access all of the point properties (from points array) through this keyword in a tooltip.formatter.
Please take a look at the Highcharts Stock API reference.
API Reference: https://api.highcharts.com/highstock/tooltip.formatter

​If you have further inquiries, you may reach out to us at any time
Best regards!
I am using tooltip formatter... However, the 2nd or 3rd option of the each point is not being passed through to the chart, almost as if it's being ignored. I've console logged this.points and it only passes the timestamp as x-axis, and [1] in the array as the y-axis.
kamil.m
Posts: 892
Joined: Thu May 19, 2022 1:33 pm

Re: Displaying additional data in tooltip

Hi there,

Thank you for the explanation. Now I understand what is the issue with your data.
In Highcharts, if you want to pass your data in an array, you can only use it like here: [x,y]. All of the other values will be ignored, just like you mentioned earlier. You cannot add any other custom values into an array.

If you would like to pass some of your custom values into your point data, you have to structure it like an object, please see the demo below.
DEMO: https://jsfiddle.net/BlackLabel/e7yuga5d/

I hope that is what you were looking for,
Best regards!
Kamil Musiałowski
Highcharts Developer

Return to “Highcharts Stock”