| | |
| | | components: {}, |
| | | data() { |
| | | //这里存放数据 |
| | | return { myChart }; |
| | | return { myChart:null }; |
| | | }, |
| | | mounted() { |
| | | this.lineChart(); |
| | |
| | | let option = { |
| | | title: { |
| | | text: '各项目数据量', |
| | | top:15, |
| | | textStyle: { |
| | | color: '#fff', |
| | | }, |
| | |
| | | const zoomSize = 6; |
| | | this.myChart = this.$echarts.init(document.getElementById('echart26')); |
| | | this.myChart.on('click', function (params) { |
| | | console.log(dataAxis[Math.max(params.dataIndex - zoomSize / 2, 0)]); |
| | | |
| | | this.myChart.dispatchAction({ |
| | | type: 'dataZoom', |
| | | startValue: dataAxis[Math.max(params.dataIndex - zoomSize / 2, 0)], |
| | |
| | | //@import url(); 引入公共css类 |
| | | .echart26_box { |
| | | padding: 20px; |
| | | } |
| | | #echart26 { |
| | | width: 100%; |
| | | height: 100%; |
| | | } |
| | | #echart26 { |
| | | width: calc(100% - 40px); |
| | | height: calc(100% - 40px); |
| | | } |
| | | </style> |