9

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?

ab_732
  • 3,639
  • 6
  • 45
  • 61
  • Must be something in the compile. htm2pdf.co.uk uses wkhtmltopdf and it works there. – user1914292 Mar 03 '13 at 18:27
  • 1
    If you set `plotOptions.series.animation` to false, you can probably reduce or even remove the --javascript-delay and get your PDF ready faster. – rjmunro Apr 10 '14 at 22:48

2 Answers2

12

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.

ab_732
  • 3,639
  • 6
  • 45
  • 61
4

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; }
davidfurber
  • 5,274
  • 1
  • 20
  • 11
  • Hiding the mouse-tracking path did the trick for me, but this CSS worked for me instead: `path.highcharts-tracker { display:none; }` – wiz Feb 07 '14 at 16:38