anu_1555
Posts: 47
Joined: Sun Nov 28, 2021 8:45 am

Data labels bidirectional bar charts

HI,

I am trying to add datalabels for bi-directional bar charts and found that datalables is getting displayed inside the left axis when there is zero data on the left hand side .How can we display the zero values always outside the bar as we are showing on the right side of the chart. also attached the screenshot below.Thanks

here is the fiddle link: https://jsfiddle.net/vjaw93up/12/
Attachments
datalabels1.PNG
datalabels1.PNG (7.47 KiB) Viewed 234 times
hubert.k
Posts: 1164
Joined: Mon Apr 11, 2022 11:48 am

Re: Data labels bidirectional bar charts

Hello anu_1555!
We appreciate you reaching out to us!

As you know, the bi-directional bar chart is a little custom chart, because we are using special settings of axes, so some things could need some adjustment, like in your case. I think the best way will be to move the data label a little bit to the left when point.y is equal to 0. Please, check it in the demo below.

Demo: https://jsfiddle.net/BlackLabel/tv96xd8z/
API Reference: https://api.highcharts.com/class-refere ... ement#attr
https://api.highcharts.com/highcharts/c ... nts.render

Feel free to ask any further questions.
Kind regards!
Hubert Kozik
Highcharts Developer

Return to “Highcharts Usage”