series: [
{
data: [150, 230, 224, 218, 135, 150, 230, 224, 218, 135, 150, 230, 224, 218, 135, 150, 230, 224, 218, 135, 150, 230, 224, 218, 135, 150, 230, 224, 218, 135],
type: 'line',
smooth: true,
color: "#9DD3E8",
//核心!!!!,这个lable可以显示图表数据!!!
label: {
show:true,
position:'bottom',
textStyle:{
fontSize:20,
color:'#fff'
},
formatter: (params) => {
if (option.series[0].data.length - 1 == params.dataIndex) {
console.log(params)
console.log(params.value)
return params.value
} else {
return ""
}
},
},
markLine: {
symbol: 'none',
label: {
show: false
},
lineStyle:{
color:'red'
},
data: [
{
yAxis: 200
}
]
},
},
]
echarts——折线图显示最后一个数据
最新推荐文章于 2024-06-07 15:05:33 发布