echars 折线图使用

option = {
      legend: {
        data: ['安全趋势'],
        x: 20,
        y: 20,
        textStyle: {
          color: '#fff',
          fontSize: 14
        }
      },
      visualMap: {
        show: false,
        pieces: [{  //点在不同数值范围颜色不同
          gte: 0,
          lt: 60,
          color: 'red'
        }, {
          gte: 60,
          lt: 80,
          color: 'yellow'
        }, {
          gte: 80,
          lte: 100,
          color: 'green'
        }],
        outOfRange: {
          color: '#999'
        }
      },
      xAxis: {
        type: 'category',
        boundaryGap: false,
        data: keys,
        axisLabel: {
          show: true,
          textStyle: {
            color: '#fff',
            fontSize: 14
          }
        },
        axisLine: {
          lineStyle: {
            color: '#245665'
          }
        },
        splitLine: {
          show: true,
          lineStyle: {
            color: ['#245665'],
             1
          }
        }
      },
      yAxis: {
        type: 'value',
        max: 100,
        min: 0,
        splitNumber: 5,
        axisLabel: {
          show: true,
          textStyle: {
            color: '#fff',
            fontSize: 14
          }
        },
        axisLine: {
          lineStyle: {
            color: '#245665'
          }
        },
        splitLine: {
          show: true,
          lineStyle: {
            color: ['#245665'],
             1
          }
        }
      },
      series: [
        {
          name: '安全趋势',
          type: 'line',
          symbol: 'circle',
          symbolSize: 8,
          data: values,
          itemStyle: {
            normal: {
              color: '#00FFCD',
              lineStyle: {
                color: '#00FFCD',
                 2
              }
            }

          }
        }
      ]
    }
点关注各类It学习资源免费送+V 1153553800
原文地址:https://www.cnblogs.com/binary1010/p/13539494.html