我不知道为什么wkhtmltopdf无法计算我的雷达图。与其他图表(如饼图)一起使用时效果很好。
这是我的代码: 首先,我加载Chart.js + jQuery
<script src="https://cdnjs.cloudflare.com/ajax/libs/Chart.js/2.5.0/Chart.min.js"></script>
<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.js"></script>
然后我创建一个绝对的<canvas>
<canvas id="marksChart" width="400" height="400" style="background-color: red;"></canvas>
这是我的查询:
<script>
var marksCanvas = document.getElementById("marksChart");
var marksData = {
labels: ["English", "Maths", "Physics", "Chemistry", "Biology", "History"],
datasets: [{
label: "Student A",
backgroundColor: "rgba(200,0,0,0.2)",
animateScale : false,
data: [65, 75, 70, 80, 60, 80]
}, {
label: "Student B",
backgroundColor: "rgba(0,0,200,0.2)",
animateScale : false,
data: [54, 65, 60, 70, 70, 75]
}],animateScale : false,
};
var radarChart = new Chart(
marksCanvas, {
type: 'radar',
data: marksData,
options:{
segmentShowStroke : true,
segmentStrokeColor : "#fff",
segmentStrokeWidth : 2,
percentageInnerCutout : 50,
animationSteps : 100,
animationEasing : "easeOutBounce",
animation : false,
animateScale : false,
responsive: false,
maintainAspectRatio: true,
showScale: true,
}
});
</script>
因此,当我使用wkhtmltopdf计算时,会收到此错误消息:
正在加载页面(1/6)[>] 0%[===>] 5%[======>] 10%[======>] 10% [========>] 12%[============>] 20%[==============>] 24% [===================>] 32%[=======================] 35% [=========================>] 43% [=========================================>] 71% [==========================================>] 72% [=========================================> [===========================================>] 74%< / p>
它似乎停留在74%,我只计算图表(没有其他页面)
有什么想法吗?
非常感谢