Commit 553e7aed authored by Jenny's avatar Jenny

feat: 饼图数据

parent 99fe34be
......@@ -3,8 +3,8 @@
<uni-ec-canvas
class="uni-ec-canvas"
id="normal-pie"
ref="canvas"
canvas-id="lazy-load-chart"
ref="normalPieCanvas"
canvas-id="normal-pie-chart"
:ec="ec"
></uni-ec-canvas>
</view>
......@@ -39,14 +39,14 @@ export default {
methods: {
initChart() {
this.$nextTick(() => {
this.$refs['canvas'].init((canvas, width, height, canvasDpr) => {
this.$refs['normalPieCanvas'].init((canvas, width, height, canvasDpr) => {
chart = echarts.init(canvas, null, {
width: width,
height: height,
devicePixelRatio: canvasDpr
})
canvas.setChart(chart)
const { dataList: { categories, series } } = this.elementData
const { dataList: { series } } = this.elementData
const options = {
...this.elementInfo.option,
color: ['#1089E7', '#F57474', '#56D0E3', '#F8B448', '#8B78F6'],
......@@ -67,9 +67,12 @@ export default {
const series = [{
type: 'pie',
center: ["50%", "50%"],
...props.elementInfo.option.pie,
...this.elementInfo.option.pie,
label: {
...props.elementInfo.option.dataset
...this.elementInfo.option.dataset,
formatter: (val) => {
return this.$u.common.converFunction(this.elementInfo.option.dataset.formatter, val)
}
},
labelLine: {
show: true
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment