全图默认背景色
option = {
backgroundColor: new echarts.graphic.LinearGradient(
0, 0, 0, 1,
[{offset: 0, color: '#000'},
{offset: 0.5, color: '#888'},
{offset: 1, color: '#ddd'}]
)
,
}
图表,柱子渐变色
series : [
{
name:'使用频率',
type:'bar',
barWidth: '30%',
data:[ 52, 134, 148, 175, 104],
itemStyle:{
barBorderRadius: [5,5,0,0],
//新建一个渐变色生成器
color: new echarts.graphic.LinearGradient(
0, 0, 0, 1,
[
{offset: 0, color: '#00d4ff'},
{offset: 1, color: '#8e3ff4'}
]
)
}
}
]