使用dataset之后,如果使用stack,则坐标轴刻度就固定了,点击对应的legend也无法动态加载坐标轴了
配置项如下
setTimeout(function () {
option = {
legend: {},
tooltip: {
trigger: 'axis'
},
dataset: {
source: [
["status","有效商户","低效商户","无效商户"],
["商服","210.00","90.60","10.15"],
["保险","1.00","0.20","0.05"],
["投融资","1.00","0.20","0.05"],
["行业","44.00","4.60","0.80"],
["个人","1.00","0.20","0.05"],
["银行","0.01","0.00","0.00"]
]
},
xAxis: {type: 'category'},
yAxis: {gridIndex: 0},
series: [
{type: 'line',stack:'1',smooth: true,areaStyle: {normal: {}}},
{type: 'line',stack:'1',smooth: true,areaStyle: {normal: {}}},
{type: 'line',stack:'1',smooth: true,areaStyle: {normal: {}}}
]
};
myChart.setOption(option);
});