0

Following code i tried to render and export Highchart SVG Image. I am able to get image downloaded while I Haven't hovered over my image(while there was no tooltip got added) enter image description here

But when i hover over image there is a new element get added which contains tooltip of highchart. and then I'm unable to export Image through canvg after that. enter image description here

var s = new XMLSerializer().serializeToString($(rawSVGHTML)[0]);

var canvas = document.createElement("canvas");
        cctx = canvas.getContext("2d");
        canvas.width = dimention.width;
        canvas.height = dimention.height;
        cctx.drawSvg(s); //It is a function from Canvg library
Dhawal
  • 84
  • 15
  • Could you reproduce it somehow in online code editor like jsfiddle? Is it not working only on Edge? – Wojciech Chmiel Feb 15 '19 at 07:39
  • @WojciechChmiel For other browser i created a base64 and appended over it to a link and downloaded through that but as IE support MSToBlob I tried that as well but unfortunately i got blank Image. – Dhawal Feb 15 '19 at 09:11
  • Then I tried Canvg Library, Without hover over chart it got exported(As i have mentioned I'm getting a tooltip later after hover over chart). But when i do it The Canvg throwing an error – Dhawal Feb 15 '19 at 09:13
  • Even i tried removing tooltip div runtime and tried to bind it again after download but It's not worrking through that way. – Dhawal Feb 15 '19 at 09:15
  • And have you considered using Highcharts exporting module? Check here: https://www.highcharts.com/docs/export-module/export-module-overview, https://api.highcharts.com/highmaps/exporting – Wojciech Chmiel Feb 15 '19 at 10:00
  • Look jsfiddle https://jsfiddle.net/hg765s34/11/ – Dhawal Feb 15 '19 at 10:06
  • Yup i used all required module and generated chart accordingly. – Dhawal Feb 15 '19 at 10:07
  • Yes, but this map was generated by canvg and not highcharts export, isn't it? – Wojciech Chmiel Feb 15 '19 at 13:06
  • @WojciechChmiel I haven't used highchart export. the problem was with rgbcolor library which was missing before canvg library, so i fixed issue using that lib. Thanks for your time. – Dhawal Feb 27 '19 at 13:48
  • You're welcome;) – Wojciech Chmiel Feb 27 '19 at 13:58

0 Answers0