alxscms
Posts: 1
Joined: Wed Oct 13, 2021 2:17 pm

SVG with use element not working in version 9

Hi,
I have been using Highcharts for several year now and decided to update recently to the latest version (9.2.2). I am using custom tooltips and labels formatters with svg elements for icons using the <use> element (https://developer.mozilla.org/en-US/doc ... e/href#use).
After upgrading to version 9 my icons don't show up anymore even though the elements are correctly inserted in the DOM.

I have already added the required attributes and tags to their corresponding list with the following code so that they are not escaped by Highcharts:

Code: Select all

Highcharts.AST.allowedTags.push("use");
Highcharts.AST.allowedAttributes.push("xlink:href");
After having investigated quite a bit, I have noted that executing the following script in the devtools icons get properly rendered:

Code: Select all

tooltip.innerHtml = tooltip.innerHtml; // tooltip being the HTML Node corresponding to the tooltip
Am I missing something ? Thanks a lot for your help.
michal.f
Posts: 1114
Joined: Thu Aug 12, 2021 12:04 pm

Re: SVG with use element not working in version 9

Hello,

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

Could you reproduce the issue in an online editor that I could work on?

Best regards!
Michał Filipiec
Highcharts Developer
https://blacklabel.pl/highcharts/

Return to “Highcharts Stock”