Requirement: There are currently 4 polylines, and only two polylines are displayed by default.
After reading the documentation of echarts, the selected of the legend attribute can be controlled
legend: {
orient: "vertical",
show: _this.legendShow,
top: 120,
right: -10,
textStyle: {
color: "rgba(255, 255, 255, 0.7)",
},
data: ["订单量", "交货量", "发货量(过账)", "缺货量"],
selected: {
//在这里设置就ok了
'订单量': true,
'交货量': false,
'发货量(过账)':true,
'缺货量':false
}
},
result: