| | |
| | | <template> |
| | | <div ref="lineChart" :style="{width:defineW+'px',height:defineH+'px'}"></div> |
| | | <div ref="lineChart" style="width:100%;height:100%"></div> |
| | | </template> |
| | | |
| | | <script> |
| | |
| | | props: { |
| | | options: { |
| | | type: Object |
| | | }, |
| | | defineW: { |
| | | type: Number, |
| | | default: 600, |
| | | }, |
| | | defineH: { |
| | | type: Number, |
| | | default: 300, |
| | | } |
| | | }, |
| | | mounted () { |
| | | mounted() { |
| | | this.initLineChart(); |
| | | }, |
| | | methods: { |
| | | initLineChart () { |
| | | initLineChart() { |
| | | this.$nextTick(() => { |
| | | let dom = this.$echarts.init(this.$refs['lineChart']); |
| | | dom.setOption(this.options); |
| | | dom && dom.setOption(this.options); |
| | | }) |
| | | } |
| | | } |