通过鼠标悬停在依赖的图例系列上的此Highchart显示/隐藏数据标签的示例;
plotOptions: {
series: {
dataLabels: {
enabled: true
},
events: {
mouseOver: function(event) {
$.each(this.data, function(i, point){
point.dataLabel.show();
});
},
mouseOut: function(event) {
$.each(this.data, function(i, point){
point.dataLabel.hide();
});
}
}
}
},
但是很难在普通位置显示数字。
如何解决这个问题!
提前致谢。
样本:JSFiddle
您需要启用allowOverlap
数据标签选项:
plotOptions: {
series: {
dataLabels: {
enabled: true,
allowOverlap: true
},
...
}
}
现场演示: http : //jsfiddle.net/BlackLabel/72r5kfcn/
API参考: https ://api.highcharts.com/highcharts/series.line.dataLabels.allowOverlap
本文收集自互联网,转载请注明来源。
如有侵权,请联系 [email protected] 删除。
我来说两句