当option.color.length==1,切换主题,可以发现只有serie0响应了option.color,其他则使用主题色。但直接在series.i中赋值data,则所有series都可以循环读取option.color中的颜色
配置项如下
option = {
color: ['#FF0'],
// 当主题不为default时,serie0使用color,其他series使用主题色
legend: {},
tooltip: {},
dataset: {
source: [
['product', '2015', '2016', '2017'],
['Matcha Latte', 43.3, 85.8, 93.7],
['Milk Tea', 83.1, 73.4, 55.1],
['Cheese Cocoa', 86.4, 65.2, 82.5],
['Walnut Brownie', 72.4, 53.9, 39.1]
]
},
xAxis: {type: 'category'},
yAxis: {},
series: [
{type: 'bar'},
{type: 'bar'},
{type: 'bar'}
]
};