配置:
option = {
xAxis: {},
yAxis: {},
series: [
{
// 每个点得横纵坐标
data: [
[1, 1],
[2, 2],
[3, 3]
],
type: 'line',
color: '#6583db',
itemStyle: {
normal: {
lineStyle: {
type: 'lined'
}
}
}
},
{
data: [
// 每个点得横纵坐标
[undefined, undefined],
[3, 3],
[4, 4]
],
type: 'line',
color: '#6583db',
itemStyle: {
normal: {
lineStyle: {
type: 'dotted' // 设置虚线
}
}
}
},
{
// 每个点得横纵坐标
data: [
[1, 3],
[2, 4],
[3, 5]
],
color: 'red',
type: 'line',
itemStyle: {
normal: {
lineStyle: {
type: 'lined'
}
}
}
}
]
};
效果图: