huy21110027781
Posts: 4
Joined: Sun May 01, 2022 8:53 am

Custom tooltip in the same line

Hi all,

I custom the type MACD (don't use the default macd type) chart by creating 3 series Histogram, MACD, and Signal ( type column and spline).
And I want to show the tooltip in 1 line but it shows in 3 lines separate.
Is it possible to make the MACD display in 1 line? Similar Price

Image


Example: https://jsfiddle.net/huy21110027781/ucwxtady/5/
michal.f
Posts: 1114
Joined: Thu Aug 12, 2021 12:04 pm

Re: Custom tooltip in the same line

Hello,

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

You can use tooltip.formatter() callback function to achieve this. The first returned item is the header (date), subsequent items are the points. The first point is the price which has slightly different formatting, so you can use a switch so that the first element is returned in a different form and all other points are returned as the second element.

Demo: https://jsfiddle.net/BlackLabel/07kjg41v/
API: https://api.highcharts.com/highcharts/tooltip.formatter

Let me know if you have any further questions!
Best regards!
Michał Filipiec
Highcharts Developer
https://blacklabel.pl/highcharts/
huy21110027781
Posts: 4
Joined: Sun May 01, 2022 8:53 am

Re: Custom tooltip in the same line

Thanks a lot for your solution. I did it. :)
michal.f
Posts: 1114
Joined: Thu Aug 12, 2021 12:04 pm

Re: Custom tooltip in the same line

You're welcome!

Feel free to ask any further questions!
Best regards!
Michał Filipiec
Highcharts Developer
https://blacklabel.pl/highcharts/

Return to “Highcharts Stock”