Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Wkhtmltopdf fails to printing SVG path (highchart)

I am trying to create a PDF from a JS highchart chart, like this one: http://www.highcharts.com/stock/demo/

It needs JS delay so

wkhtmltopdf --javascript-delay 1000 http://www.highcharts.com/stock/demo/ pdftest1.pdf

In the result I see only a grey thick line.

I'm using the version 0.11.0 rc2 of the component on Windows 7. Is anyone else experiencing the same issues?

like image 476
ab_732 Avatar asked Jan 04 '13 15:01

ab_732


2 Answers

Here a workaround. The trick is to set plotOptions.series.enableMouseTracking to false.

This because the gray line is the "mouse track" area of the chart and for some reasons it's not hidden by wkhtmltopdf.

like image 125
ab_732 Avatar answered Nov 16 '22 12:11

ab_732


A bit late to the party, but I found adding this to the CSS I send to wkhtmltopdf hides the offending mouse track area, plus the shadow under the lines that doesn't look as good in the PDF version.

g.highcharts-tracker, g.highcharts-tooltip, path[isShadow] { display:none; }
like image 42
davidfurber Avatar answered Nov 16 '22 13:11

davidfurber