| | |
| | | allSeries: [], |
| | | option: null, |
| | | pageSize: 200, |
| | | progress: 0 |
| | | progress: 0, |
| | | // 对应progress进度下,所展示数据的起始索引 |
| | | sIndex: 0 |
| | | }; |
| | | }, |
| | | emits: ['chartClick'], |
| | |
| | | len = len < 0 ? 0 : len; |
| | | const sIndex = Math.round((len * this.progress) / 100); |
| | | const eIndex = sIndex + this.pageSize; |
| | | const startPer = (sIndex / this.allXAxis.length) * 100; |
| | | const startPer = (this.sIndex / this.allXAxis.length) * 100; |
| | | const endPer = (eIndex / this.allXAxis.length) * 100; |
| | | this.sIndex = sIndex; |
| | | return { sIndex, eIndex, startPer, endPer }; |
| | | } |
| | | }, |
| | |
| | | mounted() { |
| | | this.lineChart = echarts.init(this.$refs.lineChart); |
| | | this.lineChart.on('click', (e) => { |
| | | this.$emit('chartClick', e.dataIndex); |
| | | console.log(e); |
| | | this.$emit('chartClick', this.sIndex + e.dataIndex); |
| | | }); |
| | | } |
| | | }; |