python使用pdfkit将html转化为pdf,echarts图不显示问题解决办法
设置宽度和高度
设置enableMouseTracking,shadow,animation
option = {
tooltip: {
trigger: 'axis',
axisPointer: {
type: 'shadow'
}
},
enableMouseTracking: false,
shadow: false,
animation: false ,
textStyle:{animation:false},
grid: {
left: '3%',
right: '4%',
bottom: '3%',
containLabel: true
},
xAxis: [
{
type: 'category',
data: ['Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat', 'Sun'],
axisTick: {
alignWithLabel: true
}
}
],
yAxis: [
{
type: 'value'
}
],
series: [
{
name: 'Direct',
type: 'bar',
barWidth: '60%',
data: [10, 52, 200, 334, 390, 330, 220]
}
]
};
<div id="container" style="width: 800px;height:600px"></div>
此时就可以转换成功了。
在这里插入图片描述