Data labels (in this case cash) appear in the right place, just inside the bar on the right, most of the time. However if the value of the bar is low enough, it ends up overlapping with the axis label (as shown by the purple bar).
My first instinct was to set a max value and change the position of the data-label base on that. Something like, if value is less than $10 place the label outside just to the right of the bar. But there is a big problem with that approach. The size of the chart is variable and responsive, so that threshold needs to be variable.
Ideally the bar itself should be measured and compared with the width of the data label to determine position. Achieving that solution has me at a loss. I have had no luck in getting the phyiscal size of the bar out of high charts, or the datalabel for that matter.
Thanks in advance folks!
UPDATE for Jugal Thakkar's solution on an Android 2.1 device
You can change X and Y position using
attr
in the High Charts.By, Default data labels gets plotted outside the bar. So, I guess you should have set X and Y positions in the
data Labels
property.You can do something like this
Call this method once chart is loaded.
Here is the fiddle link for the reference.
Can you try this,
jsFiddle @ http://jsfiddle.net/jugal/TCjJy/
Screenshot on my android (Useragent:
Android 4.1.1 AppleWebKit/534.30 (KHTML, like Gecko)
UPDATED AGAIN. Will work on all devices which Highcharts supporting.
I think that this solution will meet your needs.