ECharts 添加渐变颜色和去除点位

option = {
 title: {
        text: '折线图颜色渐变'
    },
    tooltip: {
        trigger: 'axis',
          axisPointer: {
            type: 'cross',
            label: {
              backgroundColor: '#000'
            }
          }
    },
    grid: {
        left: '3%',
        right: '4%',
        bottom: '3%',
        containLabel: false
    },
    toolbox: {
        feature: {
            saveAsImage: {}
        }
    },
    xAxis: {
        type: 'category',
        boundaryGap: false,
        data: ['周一','周二','周三','周四','周五','周六','周日']
    },
    yAxis: {
        type: 'value'
    },
    series: [
        {
            symbol: "none", // 去除点位
            name:'邮件营销',
            type:'line',
              itemStyle: {
                normal: {
                  lineStyle: {
                    width: 3,
                    type: 'solid',
                    color: "#ff00ff" //折线的颜色
                  }
                }
              },
            areaStyle: {normal: {
                color: new echarts.graphic.LinearGradient(0, 0, 0, 1,
                  [
                      {offset: 0, color: 'red'},
                      {offset: 0.5, color: 'pink'},
                      {offset: 1, color: '#fff'}
                  ]
                )
              }},
            data: [100, 100, 100, 100, 100, 100, 70],
        }
    ]

};
posted @ 2022-08-17 15:37  会前端的洋  阅读(150)  评论(0编辑  收藏  举报