我在 HighCharts 中有一个折线图,我想在某些值高于特定阈值时有选择地显示一些标签。我研究了 dataLabels 等,但找不到有选择地显示标签的方法。
plotOptions: {
series: {
dataLabels: {
enabled: true
}
}
}
是否可以像我上面描述的那样有选择地显示标签?
最佳答案
是的,
您可以使用dataLabels.filter
来做到这一点特性。像这样的事情:
dataLabels: {
enabled: true,
format: '{point.name}',
filter: {
property: 'y',
operator: '>',
value: labelfilter // the vale that y needs to be above.
},
style: {
color: 'black',
textOutline: 'none',
fontWeight: 'normal'
}
}
关于javascript - 如何在 HighCharts 折线图中选择性地在某些点显示标签,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/58508587/