var color = ['red', 'blue', 'yellow', '#349ee7', '#349ee7', '#349ee7'];
color.push(new echarts.graphic.LinearGradient(0, 0, 0, 1, [{
offset: 0,
color: '#9a1111'
}, {
offset: 1,
color: 'rgba(203,47,47,.8)'
}]));
option = {
xAxis : [
{
type : 'category',
data : ['Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat', 'Sun'],
axisTick: {
alignWithLabel: true
}
}
],
yAxis : [
{
type : 'value'
}
],
series: [{
type: 'bar',
data:[10, 52, 200, 334, 390, 330, 220],
itemStyle: {
normal: {
color: function(params) {
return color[params.dataIndex];
}
}
}
}]
};
![这里写图片描述](//img-blog.csdn.net/20170517103130642?watermark/2/text/aHR0cDovL2Jsb2cuY3Nkbi5uZXQvbmluZzBfbw==/font/5a6L5L2T/fontsize/400/fill/I0JBQkFCMA==/dissolve/70/gravity/SouthEast)