正如您在图片中看到的那样,每列都附有其数据标签,一切都很好。细节是当少量及其数据标签与类别配置错误时,如图(红色方块)所示。我想要做的是检查你的身高是否更低,将其旋转从-90改为0(绿色字母)
请在此处查看解决方案图片(HighCharts):
https://docs.google.com/file/d/0B93NeaQX1VjUMldzcGIxNnBqaWc/edit
请参阅我的解决方案的代码JSFiddle(HighCharts):
http://jsfiddle.net/bryan376/325dev4h/1/
这是我的系列代码推送:
options.series.push({
name: 'Vendedor',
data: arrFinal,
dataLabels: {
enabled: true,
rotation: -90, //Validation height < 70 "rotation=0" else rotation=-90
color: 'black',
align: 'right',
x: 4,
y: 10,
style: {
fontSize: '11px',
fontFamily: 'Verdana, sans-serif'
}
}
});
var chart = new Highcharts.Chart(options);
}
问候
答案 0 :(得分:3)
您可以更改Highcharts.Series.prototype.drawDataLabels
,即绘制dataLabels
的功能:
Highcharts.Series.prototype.drawDataLabels = (function (func) {
return function () {
func.apply(this, arguments);
if (this.options.dataLabels.enabled || this._hasPointLabels) realignLabels(this);
};
}(Highcharts.Series.prototype.drawDataLabels));
realignLabels
将是检查较短列的功能,并在其中更改特定rotation
的{{1}},x
和y
:
dataLabel