zmc
2023-12-01 28cbf4f043cfc0a4621cc8683ba66bcbdd350eca
src/utils/chartFunction/exceptionOption.js
@@ -8,7 +8,7 @@
   * @param:异常类型
   * @returns:
   */
  setExceptionChartOption(
  setExceptionChartOption({
    xData,
    yData,
    exceptionBeginTime,
@@ -17,7 +17,9 @@
    endIndex,
    exceptionName,
    areaObj,
    lineColor,
    exceptionType
  }
  ) {
    switch (exceptionType) {
      case '0':
@@ -65,7 +67,8 @@
          exceptionName
        )
      case '8':
        return this.validOption(xData, yData, exceptionName, areaObj)
        console.log('传进来',lineColor)
        return this.validOption(xData, yData, exceptionName, areaObj,lineColor)
    }
  },
@@ -301,7 +304,7 @@
          name: '颗粒物浓度',
          type: 'line',
          data: yData.map((item) => {
            if (item <= 0.01) {
            if (item <= 0.02) {
              return {
                value: item,
                itemStyle: {
@@ -331,9 +334,8 @@
              {
                name: '数据超低',
                type: 'average',
                yAxis: 0.01,
                yAxis: 0.02,
                lineStyle: {
                  // color: '#ff0000'
                  color: 'red'
                }
              }
@@ -564,7 +566,7 @@
   * @param:
   * @returns:
   */
  validOption(xData, yData, exceptionName, areaObj) {
  validOption(xData, yData, exceptionName, areaObj,lineColor) {
    return {
      title: {
        text: exceptionName,
@@ -577,9 +579,6 @@
      toolbox: {
        // 工具栏
        feature: {
          // dataZoom: {
          //   yAxisIndex: 'none'
          // },
          // 保存为图片
          saveAsImage: {}
        }
@@ -622,7 +621,32 @@
            data: areaObj
          }
        }
      ]
      ],
      // 指定时间区间的线段变颜色
      // visualMap: {
      //   show: false,
      //   dimension: 0,
      //   // pieces: [
      //   //   {
      //   //     lte: beginIndex,
      //   //     color: 'green'
      //   //   },
      //   //   {
      //   //     gt: beginIndex,
      //   //     lte: endIndex,
      //   //     color: 'red'
      //   //   },
      //   //   {
      //   //     gt: endIndex,
      //   //     lte: xData.length - 1,
      //   //     color: 'green'
      //   //   }
      //   // ],
      //   pieces: lineColor
      // }
    }
  }
}