echart 折线图 显示多个最大值和最小值

注:realMin和realMax为提前计算好的最小值和最大值
this.inPriceLog.length && this.inPriceLog.forEach((log, index) => {
      let extre: any = {}
      if (log.newInPrice === realMin) {
        extre.name = ‘最小值’
        extre.value = realMin
        extre.xAxis = index
        extre.yAxis = realMin
        extremeList.push(extre)
      } else if (log.newInPrice === realMax) {
        extre.name = ‘最大值’
        extre.value = realMax
        extre.xAxis = index
        extre.yAxis = realMax
        extremeList.push(extre)
      }
    })

1.name::名称
2.value:气泡中显示的值
3.xAxis:X轴的索引(从0开始)
4.yAxis:Y轴的值

markPoint: {
            data: extremeList
          }

echart 折线图 显示多个最大值和最小值_第1张图片

你可能感兴趣的:(ecahrt,vue.js,javascript)