-->

highcharts display in my render html page which i

2019-05-26 04:54发布

问题:

I have an html page with some text data and graph. I am using wkhtmltopdf gem to generate pdf from html page. Using highcharts, i am generating graph.

I am able to generate PDF successfully but PDF only contains text data and doesn't have graph in it.

I already tried with some options as below

 - plotOptions: { series: { enableMouseTracking: false, shadow: false, animation: false } }, in Hightcharts jquery coding..

Please assist me to resolve this issue.

回答1:

I am not familiar w/wkhtmltopdf but I do use wkhtmltoimage to create images of pages that contain graphs from highcharts. One thing I noticed is that I had to set --javascript-delay to be several seconds long to make sure the chart had enough time to load. It seems as though wkhtmltopdf does support this option (wkhtmltopdf v0.10.0_rc2 docs). Can you see if that helps?

Here is how we call it w/a javascript delay of 3 seconds:

/bin/wkhtmltoimage --javascript-delay 3000 "http://example.com/chartPage" "/path/to/image.png"