src/utils/chartFunction/lineChart.js
@@ -47,10 +47,6 @@
        xData.push(tempData.lst)
        yAvg.push(tempData.dayAvg)
        // yOnline.push(this.deleteLastStr(tempData.dayOnline))
        // yValid.push(this.deleteLastStr(tempData.dayValid))
        // yExceed.push(this.deleteLastStr(tempData.dayExceeding))
        yOnline.push(tempData.dayOnline)
        yValid.push(tempData.dayValid)
        yExceed.push(tempData.dayExceeding)
@@ -123,7 +119,7 @@
   * @param: 2维数组
   * @returns:
   */
  getMarkArea(timeInteval,describe='无数据') {
  getMarkArea(timeInteval, describe = '无数据') {
    let result = []
    for (let i = 0; i < timeInteval.length; i++) {
      let temp = []
@@ -170,48 +166,44 @@
    return valueStr.slice(0, -1)
  },
  /**
   * 指定时间区间的线段变颜色
   * @param:
   * @param:
   * @returns:
   */
  getLineColor(timeInteval,xList){
  getLineColor(timeInteval, xList) {
    let result = []
    // 只取
    let temp = []
    for (let i = 0; i < timeInteval.length; i++){
      if(timeInteval[i][0]!=timeInteval[i][1]){
    for (let i = 0; i < timeInteval.length; i++) {
      if (timeInteval[i][0] != timeInteval[i][1]) {
        temp.push(timeInteval[i])
      }
    }
    }
    // 无连续的数据 直接退出
    if(temp.length == 0){
    if (temp.length == 0) {
      return []
    }
    // 取第一个连续的时段
    result.push(
      [
    result.push([
      {
        lte: temp[0][0],
        color: 'green'
      },
      {
        gt: temp[0][0],
        lte:temp[0][1],
        lte: temp[0][1],
        color: 'red'
      },
      {
        gt: temp[0][1],
        lte:xList[xList.length-1],
        lte: xList[xList.length - 1],
        color: 'green'
      }
    ]
    )
    ])
    return result[0]
  },
  }
}