let xLabel = [
'1月',
'2月',
'3月',
'4月',
'5月',
'6月',
'7月',
'8月',
'9月',
'10月',
'11月',
'12月'
];
let dataValue = [510, 465, 440, 570, 480, 615];
let dataValue1 = [
...new Array(dataValue.length - 1).fill('-'),
dataValue[dataValue.length - 1],
690,
525,
354,
442,
420,
900
];
option = {
tooltip: {
trigger: 'axis'
},
legend: {
show: true,
itemWidth: 30,
itemHeight: 10
},
xAxis: [
{
type: 'category',
data: xLabel
}
],
yAxis: [
{
type: 'value'
}
],
series: [
{
name: '预测',
type: 'line',
symbol: 'none',
smooth: true,
data: dataValue
},
{
name: '预测',
type: 'line',
symbol: 'none',
smooth: true,
itemStyle: {
normal: {
lineStyle: {
type: 'dotted'
}
}
},
data: dataValue1
}
]
};
echart 折线图 某个数据之后线变为虚线
最新推荐文章于 2024-09-29 16:28:29 发布