dktg
Posts: 151
Joined: Mon Jan 29, 2018 2:19 pm

Circles in color of series in tooltip

Hi, we have a chart with a shared costum tooltip where we would like to include a small circle in the color of the particular serie in front of the series name in the tooltip. In the following example you find the code where I managed to include the symbol however not in the correct color: https://jsfiddle.net/statistik_tg/b3yzsuaL/2/.

How would I have to modify the code of the tooltip definition so that the circles appear in the respecting color of the serie?

Thanks for your help and kind regards,
Daniela
hubert.k
Posts: 1164
Joined: Mon Apr 11, 2022 11:48 am

Re: Circles in color of series in tooltip

Hello Daniela!
We appreciate you reaching out to us!

All you need to add is to wrap the span around the dot with proper CSS style based on series.color variable.

Code: Select all

<span style="color: ' + ser.color +'">\u25CF</span>
You can see it in the demo below.

Demo: https://jsfiddle.net/BlackLabel/f3d0ju5h/

Let me know if you have any further questions.
Best regards!
Hubert Kozik
Highcharts Developer
dktg
Posts: 151
Joined: Mon Jan 29, 2018 2:19 pm

Re: Circles in color of series in tooltip

Thank you for the code. I forgot the first part of the <span>, now it works :).
Kind regards,
hubert.k
Posts: 1164
Joined: Mon Apr 11, 2022 11:48 am

Re: Circles in color of series in tooltip

You're welcome! In case of any further questions, feel free to contact us again.
Hubert Kozik
Highcharts Developer

Return to “Highcharts Usage”