|
93 | 93 | export default { |
94 | 94 | data() { |
95 | 95 | return { |
96 | | - // echarts: echarts, |
97 | 96 | updateStatus: false |
98 | 97 | } |
99 | 98 | }, |
|
119 | 118 | this.$refs.pieChart.init(); |
120 | 119 | this.updateStatus = true; |
121 | 120 | }, |
122 | | - // pieInit(canvas, width, height) { |
123 | 121 | pieInit(e) { |
124 | | - let {canvas, width, height,fire} = e ; |
| 122 | + let { width, height} = e ; |
| 123 | + let canvas = this.$refs.pieChart.canvas |
125 | 124 | echarts.setCanvasCreator(() => canvas); |
126 | 125 | let pieChart = echarts.init(canvas, null, { |
127 | 126 | width: width, |
|
130 | 129 | canvas.setChart(pieChart) |
131 | 130 |
|
132 | 131 | pieChart.setOption(pieOption) |
133 | | - fire(pieChart) |
134 | | - // return pieChart |
| 132 | + this.$refs.pieChart.setChart(pieChart) |
135 | 133 | }, |
136 | | - // lineInit(canvas, width, height) { |
137 | 134 | lineInit(e) { |
138 | | - let {canvas, width, height,fire} = e ; |
| 135 | + let {width, height} = e ; |
| 136 | + let canvas = this.$refs.lineChart.canvas |
139 | 137 | echarts.setCanvasCreator(() => canvas); |
140 | 138 | let lineChart = echarts.init(canvas, null, { |
141 | 139 | width: width, |
142 | 140 | height: height |
143 | 141 | }) |
144 | 142 | canvas.setChart(lineChart) |
145 | | -
|
146 | 143 | lineChart.setOption(lineOption) |
147 | | - fire(lineChart) |
148 | | - // return lineChart |
| 144 | + this.$refs.lineChart.setChart(lineChart) |
149 | 145 | } |
150 | 146 | }, |
151 | 147 | components: { |
|
0 commit comments