src/components/Echarts/LineChartSpe.vue
@@ -45,12 +45,10 @@
  },
  watch: {
    chartData: {
      handler(val) {
        this.setOptions(val)
      },
      deep: true,
    },
  },
  mounted() {
@@ -90,22 +88,23 @@
            },
          },
          grid: {
            left: 10,
            left: 100,
            right: 10,
            bottom: 20,
            top: 30,
            height: fontSize(3.5),
            width: fontSize(15),
            containLabel: true,
          },
          toolbox: {
            feature: {
              dataZoom: {
                yAxisIndex: 'none',
              },
              restore: {},
              saveAsImage: {},
            },
          },
          // toolbox: {
          //   feature: {
          //     dataZoom: {
          //       yAxisIndex: 'none',
          //     },
          //     restore: {},
          //     saveAsImage: {},
          //   },
          // },
          // tooltip: {
          //   trigger: 'axis',
          //   position: function(pt) {
@@ -127,11 +126,55 @@
            // },
          },
          yAxis: {
            axisLabel: {
              show: false,
          yAxis: [
            {
              type: 'value',
              position: 'left',
              axisLabel: {
                show: true,
              },
            },
          },
            {
              type: 'value',
              position: 'right',
              axisLabel: {
                show: true,
              },
            },
            {
              type: 'value',
              position: 'right',
              offset: 50,
              axisLabel: {
                show: true,
              },
              min: 'dataMin', //取最小值为最小刻度
              max: 'dataMax', //取最大值为最大刻度
              min: function (value) {
                //取最小值向下取整为最小刻度
                return Math.floor(value.min)
              },
              max: function (value) {
                //取最大值向上取整为最大刻度
                return Math.ceil(value.max)
              },
              scale: true, //自适应
              minInterval: 0.1, //分割刻度
            },
            {
              type: 'value',
              position: 'left',
              axisLabel: {
                show: true,
              },
              offset: 50,
            },
          ],
          legend: {
            icon: 'circle',
            itemHeight: 15,
@@ -149,10 +192,9 @@
            {
              start: 0,
              end: 10,
              top:fontSize(4),
              top: fontSize(4),
              height: fontSize(0.4),
            },
          ],
          series: val.series,
          // [{