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' } }, } ]