// @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 // }) // }, } })