简体   繁体   中英

Highcharts data label vertical alignment - bug

Im facing an issue with highcharts js library where im trying to put the value of the point inside the shape. for this im using inside: true, verticalAlign: 'middle' for data label which seem to work just fine but whenever the point is at the start or at the end of the chart the label does not align correctly. I have already tried offset and padding but its for the whole axis not the label. I would really appreciate any suggestion, clues or solutions

http://jsfiddle.net/Andam/6km2fw31/1/ 在此处输入图像描述

Highcharts tries to position data labels on a plot area due to default justify option for overflow. As a solution change overflow to allow .

dataLabels: {
  enabled: true,
  verticalAlign: 'middle',
    crop: false,
    overflow: 'allow'
}

Live demo: http://jsfiddle.net/BlackLabel/f2r7hL3j/

API Reference: https://api.highcharts.com/highcharts/series.column.dataLabels.overflow

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM