Skip to content

The use of specific quotation marks in the tooltip.formatter() affect parsing to the DOM element. #17627

@magdalena-gut

Description

@magdalena-gut

Behaviour

Using the following code in the tooltip.formatter() doesn't change the circle colour as expected.
return '<span style="color: " + this.series.color + ";"">\u25CF</span>;

Received DOM element:
<tspan style="color: #7cb5ec;">●</tspan>

Demo:
https://jsfiddle.net/BlackLabel/51ho6by0/

Workaround:

Works correctly with proper quotation marks configuration:
return '<span style="color: ' + this.series.color + ';">\u25CF</span>';

Received DOM element:
<tspan style="color: rgb(124, 181, 236); fill: rgb(124, 181, 236);">●</tspan>

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

Last working version

In the last working version (9.3.3), color property was parsed to fill independently of quotation marks.

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

Caused by the following PR:

https://github.com/highcharts/highcharts/pull/16871/files

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions