// @ts-ignore import * as echarts from '../../../../../../components/ec-canvas/echarts.js' import {getPeopleChart2} from '../../../../utils/echarts' Component({ /** * 组件的属性列表 */ properties: { }, /** * 组件的初始数据 */ data: { ecVoiceA: { lazyLoad: true }, ecVoiceB: { lazyLoad: true }, colorData2:['#AD6DFE', '#FFA270'], chartsData2: [{ name: '好好', value: '20' }, { name: '好', value: '30' }] }, lifetimes: { attached() { // @ts-ignore this.ecComponentA = this.selectComponent('#mychart-activeA') this.initA() // @ts-ignore this.ecComponentB = this.selectComponent('#mychart-activeB') this.initB() // @ts-ignore this.ecComponentC = this.selectComponent('#mychart-activeC') this.initC() } }, 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 }) }, initC () { // @ts-ignore this.ecComponentC.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 }) }, } })