### 怎么通过dataset结合encode,做多条折线,而不是单条
单条线想改为多条
const chartOptions = {
dataset: {
source:
{
Date:[1,2,3,4,5],
Data:[4,5,6,7,8]
}
},
title: {
text: " ",
left: '32',
top: '3%',
textStyle: {
color: '#b5b4b4',
fontSize: 12
}
},
grid: { top: 20, right: 20, bottom: 40, left: 40},
xAxis: {
type: 'category',
axisTick: {
alignWithLabel: true
},
},
tooltip: {
trigger: 'axis',
},
yAxis: {
type: 'value'
},
series: [{
type: 'line',
//encode 映射上面的Date,Data
encode: {
x: 'Date',
y: 'Data'
},
}]
}
### 尝试过解决的方法就是在series里写很多的type:line解决,但是不知有没更简单的方法,求各位大佬棒棒忙
### 相关代码
dataset: {
source:
{
Date:[1,2,3,4,5],
Data:[4,5,6,7,8]
}
},
encode: {
x: 'Date',
y: 'Data'
},
### 代码需要怎么改写,感谢各位大佬,不懂得地方太多,虚心请教