Wednesday, 18 September 2013

datalabels not showing for high y-values on highcharts

datalabels not showing for high y-values on highcharts

I have a few dataLabels that are not showing (they're probably being
clipped) when they seem to exceed a certain height. Is there a way so that
I can have them shown?
For instance, the following labels are not showing as the bars are near
the tip of the graph:
{x:743.4234, y: 5954.4, color: '#cccccc', name: 'ABCDEFG'},
{x:1014.669, y: 4756.6, color: '#000000', name: 'ZXY'},
I'm thinking there's something wrong with my formatter code:
formatter: function () {
var chart = $('#container').highcharts(),
extremes = chart.yAxis[0].getExtremes();
for (var i=0;i < data.length;i++) {
if (this.y >extremes.dataMax/10){
if (this.y == data[i].y){
return data[i].name;
}
}
}
}
Here's what I have now: http://jsfiddle.net/6mMZS/27/

I would like it to show as:
An alternate approach would also be ok, although it sort of breaks the
100% thought, it would still work:
Thanks for the help!

No comments:

Post a Comment