管道基础大数据平台系统开发-【前端】-新系統界面
Surpriseplus
2023-01-16 21ddc9ec1b1b76d2ce20e512328e65acaf1af2bf
src/components/echart26.vue
@@ -10,7 +10,7 @@
  components: {},
  data() {
    //这里存放数据
    return { myChart };
    return { myChart:null };
  },
  mounted() {
    this.lineChart();
@@ -32,6 +32,7 @@
      let option = {
        title: {
          text: '各项目数据量',
          top:15,
          textStyle: {
            color: '#fff',
          },
@@ -137,7 +138,7 @@
      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)],
@@ -161,9 +162,11 @@
//@import url(); 引入公共css类
.echart26_box {
  padding: 20px;
}
#echart26 {
  width: 100%;
  height: 100%;
}
#echart26 {
  width: calc(100% - 40px);
  height: calc(100% - 40px);
}
</style>