highcharts icon indicating copy to clipboard operation
highcharts copied to clipboard

Styled mode line chart series className not applied to shared tooltip

Open fhoeben opened this issue 2 years ago • 1 comments

Expected behaviour

Given I have a line chart, in styled mode, with a shared tooltip When I apply a className to my series Then I expect that className to be applied to the tooltip element for that series Screenshot 2022-10-03 at 12 25 51

Actual behaviour

The className specified is not added to the values for the series in the tooltip

Live demo with steps to reproduce

https://codepen.io/fhoeben/pen/WNJyeNQ

Screenshot 2022-10-03 at 12 20 34

The line colours have been configured, these are applied to the labels but not to the tooltip. The tooltip elements do not have the weight or bmi class specified to their series Screenshot 2022-10-03 at 12 23 17

Product version

Highcharts JS v10.2.1 (2022-08-29)

Affected browser(s)

all

fhoeben avatar Oct 03 '22 10:10 fhoeben

Hi @fhoeben!

I agree the class name and new colors should be reflected in the tooltip while using the styledMode.

As a workaround, you can use other CSS selectors to change those colors- demo.

Similar to: https://github.com/highcharts/highcharts/issues/17346

karolkolodziej avatar Oct 06 '22 08:10 karolkolodziej

@fhoeben The safest workaround (and how coloring is intended to work), is to use the colorIndex option to handle your color-to-series mapping.

TorsteinHonsi avatar Oct 26 '22 13:10 TorsteinHonsi