榆山数据端小程序
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

55 lines
1.3 KiB

// @ts-ignore
import * as echarts from '../../../../components/ec-canvas/echarts.js'
import { getPeopleChart2 } from '../../utils/echarts'
Component({
/**
*
*/
properties: {
},
/**
*
*/
data: {
ecVoiceA: {
lazyLoad: true
},
colorData2: ['#AD6DFE', '#FFA270'],
chartsData2: [{ name: '好好', value: '20' }, { name: '好', value: '30' }]
},
lifetimes: {
attached() {
// @ts-ignore
this.ecComponentA = this.selectComponent('#mychart-voiceA')
this.initA()
}
},
methods: {
// 点击按钮后初始化图表
initA() {
// @ts-ignore
this.ecComponentA.init((canvas: any, width: any, height: any) => {
const chart = echarts.init(canvas, null, {
width: width,
height: height
})
getPeopleChart2(chart, this.data.colorData2, this.data.chartsData2)
return chart
})
},
// initB () {
// // @ts-ignore
// this.ecComponentB.init((canvas: any, width: any, height: any) => {
// const chart = echarts.init(canvas, null, {
// width: width,
// height: height
// })
// getPeopleChart2(chart,this.data.colorData2,this.data.chartsData2)
// return chart
// })
// },
}
})