| | |
| | | onReady: function () { |
| | | this.ecComponent = this.selectComponent('#mychart-dom-radar'); |
| | | this.initChart() |
| | | this.getDetail() |
| | | }, |
| | | |
| | | /** |
| | |
| | | }], |
| | | value: [100, 100, 80, 5, 67, 82] |
| | | } |
| | | this.ecComponent.init((canvas, width, height, dpr) => { |
| | | // 获取组件的 canvas、width、height 后的回调函数 |
| | | // 在这里初始化图表 |
| | | const chart = echarts.init(canvas, null, { |
| | | width: width, |
| | | height: height, |
| | | devicePixelRatio: dpr // new |
| | | setTimeout(() => { |
| | | this.ecComponent.init((canvas, width, height, dpr) => { |
| | | // 获取组件的 canvas、width、height 后的回调函数 |
| | | // 在这里初始化图表 |
| | | const chart = echarts.init(canvas, null, { |
| | | width: width, |
| | | height: height, |
| | | devicePixelRatio: dpr // new |
| | | }); |
| | | // setOption(chart, data); |
| | | |
| | | // 将图表实例绑定到 this 上,可以在其他成员函数(如 dispose)中访问 |
| | | this.chart = chart; |
| | | |
| | | this.getDetail() |
| | | |
| | | // 注意这里一定要返回 chart 实例,否则会影响事件处理等 |
| | | return chart; |
| | | }); |
| | | // setOption(chart, data); |
| | | |
| | | // 将图表实例绑定到 this 上,可以在其他成员函数(如 dispose)中访问 |
| | | this.chart = chart; |
| | | |
| | | // 注意这里一定要返回 chart 实例,否则会影响事件处理等 |
| | | return chart; |
| | | }); |
| | | }, 1000); |
| | | }, |
| | | |
| | | getDetail() { |
| | |
| | | losePoints: losePoints, |
| | | losePointsItem: losePointsItem |
| | | }) |
| | | debugger |
| | | setOption(that.chart, classPoints) |
| | | } |
| | | }) |