关于echarts:HTMLecharts改变折线图的线条颜色和区域颜色

6次阅读

共计 561 个字符,预计需要花费 2 分钟才能阅读完成。

HTML+echart 的状况下,扭转所用折线图的线条色彩。

在做的过程中,一下子想不起了怎么给 echart 的折线图线条批改色彩,而后去查阅材料发现能够通过上面增加相应代码,便可胜利批改。

折线图的线条色彩在 lineStyle 里,在 item 是指每个数据点上的图标,默认是个小圆点,上面代码曾经 pose 进去了, 依据本人的需要来批改。

// 指定图表的配置项和数据
            option6 = {
              title: {text: '月度维修费趋势图'},
              tooltip: {},
              legend: {data:['设施原值']
              },
              xAxis: {
                type: 'category',
                data: ['2020-10', '2020-11', '2020-12', '2021-01', '2021-02', '2021-03', '2021-04', '2021-05', '2021-06', '2021-07', '2022-03']
              },
              yAxis: {type: 'value'},
              series: [
                {
                  name:'设施原值',
                  data: [70, 73, 74, 78, 72, 77, 76,70, 73, 74, 78],
                  type: 'line',
                  areaStyle: {
                      normal: {color: '#daeafe' // 扭转区域色彩}
                  },
                  itemStyle: {
                    normal: {color: '#8ec8fe'}
                  },  
                }
              ]
正文完
 0