import { Component, PropsWithChildren } from 'react' import { View, Text } from '@tarojs/components' import * as echarts from '../../lib/ec-canvas/echarts' import './index.scss' export default class Index extends Component { // this.state = { // ec:{ // onInit:function(){} // } // } constructor(props) { super(props); this.state = { ec: { onInit: function (canvas, width, height) { const chart = echarts.init(canvas, null, { width: width, height: height }); canvas.setChart(chart); const option = { title: { text: 'ECharts 入门示例' }, tooltip: {}, legend: { data: ['销量'] }, xAxis: { data: ['衬衫', '羊毛衫', '雪纺衫', '裤子', '高跟鞋', '袜子'] }, yAxis: {}, series: [ { name: '销量', type: 'bar', data: [5, 20, 36, 10, 10, 20] } ] }; chart.setOption(option) return chart; } } } } componentDidMount() { } componentWillUnmount() { } componentDidShow() { } componentDidHide() { } callback(e){ } render() { return ( Hello world! { debugger }}/> Just say hi ) } }