2017-10-27 4 views
1

12.4 pdfを生成するには、chartistはchartistが描画します。chartistはsvgベースです。私はhtml(test-chartist.html right chart)でブラウザでグラフを見ることができます。しかし、私がwkhtmltopdf --dpi 300 --page-size A4 test-chartist.html test3.pdfというコマンドを使っているときは、test3.pdfの図は空白です。そして、私が流れるJSを追加し、結果はchartistが描画したグラフはwkhtmltopdfを使用して正しく表示されません

Function.prototype.bind = Function.prototype.bind || function (thisp) { 
 
    var fn = this; 
 
    return function() { 
 
     return fn.apply(thisp, arguments); 
 
    }; 
 
};

size is not right and direction is not right too奇妙です誰が私を助けることができますか?大変ありがとうございます。

答えて

1

OK、私は突然答えを見つけました。 私はグラフのオプションに幅と高さを追加する場合は以下のように、すべてが、罰金です:私はそれが他の人を助けることを願って

var options = { 
    width: 800, 
    height: 150, 
    donut: true, 
    donutWidth: 30, 
startAngle: 240, 
    total: 30, 
    showLabel: true, 
    animation:false 
}; 

new Chartist.Pie('#mainImg', { 
    series: [10,10] 
},options); 

関連する問題