- 小程序使用canvas2d模式
- 报错
[uCharts]:开启canvas2d模式,必须指定canvasId,否则会出现偶尔获取不到dom节点的问题!
<template>
//新增 canvasId="canvasColumn"
<view class="charts-box">
<qiun-data-charts type="pie" canvasId="canvasColumn" id="canvasColumn" :canvas2d="true" :chartData="chartData" background="none" />
</view>
</template>
<script>
export default {
data() {
return {
chartData: {
categories: [],
"series": [{
"data": [{
"name": "欠款总额",
"value": 50
},
{
"name": "回款总额",
"value": 30
}
]
}]
},
};
},
methods: {
oncellDateShow() {
this.show = true
},
change(e) {
console.log(e);
},
onscrol(v) {
console.log(v)
},
}
}
</script>
<style lang="scss" scoped>
.charts-box {
width: 100%;
height: 200px;
}
.tab {
width: 100%;
}
</style>