使用wkhtmltopdf将HTML导出为PDF时,行无法正确显示

时间:2017-10-23 09:09:23

标签: highcharts wkhtmltopdf

我们正在使用HighCharts在UI上显示数据。 将所有HTML页面导出为PDF Scatter图形行时会受到干扰。 对于将HTML导出为PDF,我们使用的是wkhtmltopdf。

请找附件。

Before exporting HTML page to PDF image looks like Shown in Image.

After exporting HTML page to PDF scatter line shown in Image.

1 个答案:

答案 0 :(得分:0)

答案与此主题有关

Highchart line renders bigger when exported to pdf using css2pdf

我也使用mpdf60遇到了这个问题,所以这就是我解决的方法。

如果您使用Highcharts.getSVG,请将enableMouseTracking更改为false

var chart =  $(your chart id).highcharts();
chart.options.plotOptions.line.enableMouseTracking = false;

或者您可以直接在图表上设置

plotOptions: {
        column: {
            stacking: 'normal', 
            enableMouseTracking: false
        },
        line: {
            enableMouseTracking: false
        }
},