ECharts 应用-填充折线图

作者:vkvi 来源:ITPOW(原创) 日期:2020-12-5

核心代码

option.series.push({
	name: "序列1",
	type: "line",
	data: [12, 21, 16, 27],
	smooth: true,
	areaStyle: {
		color: {
			colorStops: [{
				offset: 0, color: '#f00'
			}, {
				offset: 1, color: '#0f0'
			}]
		}
	}
});

效果

ECharts 应用-填充折线图

改变角度

option.series.push({
	name: "序列1",
	type: "line",
	data: [12, 21, 16, 27],
	smooth: true,
	areaStyle: {
		color: {
			x:0,
			y:0,
			x2:0,
			y2:1,
			colorStops: [{
				offset: 0, color: '#f00'
			}, {
				offset: 1, color: '#0f0'
			}]
		}
	}
});

效果

ECharts 应用-填充折线图

 更多参数

请参考:Documentation - Apache ECharts(incubating)

相关文章