ECharts endLabel 显示折线图尾部的标签
ECharts About 400 wordsendLabel
默认的endLabel会显示Y轴的数据({c})。
设置formatter可以显示X轴数据({b})。
option = {
xAxis: {
type: "category",
data: ["Mon", "Tue", "Wed", "Thu", "Fri", "Sat", "Sun"]
},
yAxis: {},
series: [{
data: [820, 932, 901, 934, 1290, 1330, 1320],
type: "line",
endLabel: {
show: true,
formatter: '{b}'
}
}]
}
文档
https://echarts.apache.org/zh/option.html#series-line.endLabel
Views: 4 · Posted: 2026-03-04
———         Thanks for Reading         ———
Give me a Star, Thanks:)
https://github.com/fendoudebb/LiteNote扫描下方二维码关注公众号和小程序↓↓↓
Loading...