zmc
2023-11-16 73cb3ec2b1660610e3621d7614ad308f2c19331d
src/views/risk_assessment/components/LineChart.vue
ÎļþÃû´Ó src/views/line_graph/components/LineChart.vue ÐÞ¸Ä
@@ -35,6 +35,12 @@
    seriesName: {
      type: String,
      default: '系列一'
    },
    areaColor: {
      type: Array,
      default: () => {
        return []
      }
    }
  },
  data() {
@@ -44,6 +50,7 @@
  },
  mounted() {
    this.intiChart()
    window.addEventListener('resize', this.resizeChart)
  },
  watch: {
@@ -70,11 +77,6 @@
        toolbox: {
          // å·¥å…·æ 
          feature: {
            // dataZoom: {
            //   // åŒºåŸŸç¼©æ”¾
            //   yAxisIndex: 'none'
            // },
            // ä¿å­˜ä¸ºå›¾ç‰‡
            saveAsImage: {}
          }
@@ -101,7 +103,16 @@
          {
            name: this.seriesName,
            type: 'line',
            data: this.chartData.y
            data: this.chartData.y,
            // å˜æ¢æŒ‡å®šæ—¶é—´åŒºé—´çš„背景颜色
            markArea: {
              itemStyle: {
                color: '#e5e6eb'
              },
              data: this.areaColor
            }
          }
        ]
      }
@@ -124,5 +135,6 @@
  height: 300px;
  margin-top: 25px;
  margin-left: 30px;
  color: #535a64;
}
</style>