You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
With a percentage, we can denote how far away the data labels should be placed in related to the radius length.
Actual behaviour
See document(https://api.highcharts.com/highcharts/series.pie.dataLabels.distance):
distance: NumberSince 2.1
The distance of the data label from the pie's edge. Negative numbers put the data label on top of the pie slices. Connectors are only shown for data labels outside the pie.
Defaults to 30
Currently it is not straight forward to put data labels in related to the radius length in pie chart, like say, put the labels at the center of the radius ? or put the labels outside the pie, the label is 1.5 times radius length away from the pie center...
Since the chart size can be changed (via resize, etc), we have to draw the pie first, get the chart radius, calculate the distance in number, and update this property afterwards. Why not make this supported internally with a percentage value?
So you can draw the pie with something like
plotOptions: {
pie: {
dataLabels: {
distance: 50%
}
}
},
With this, the labels will always be at the middle point of the radius, no matter how the pie chart is resized....
Live demo with steps to reproduce
Product version
Affected browser(s)
The text was updated successfully, but these errors were encountered:
Expected behavior
With a percentage, we can denote how far away the data labels should be placed in related to the radius length.
Actual behaviour
See document(https://api.highcharts.com/highcharts/series.pie.dataLabels.distance):
distance: NumberSince 2.1
The distance of the data label from the pie's edge. Negative numbers put the data label on top of the pie slices. Connectors are only shown for data labels outside the pie.
Defaults to 30
Currently it is not straight forward to put data labels in related to the radius length in pie chart, like say, put the labels at the center of the radius ? or put the labels outside the pie, the label is 1.5 times radius length away from the pie center...
Since the chart size can be changed (via resize, etc), we have to draw the pie first, get the chart radius, calculate the distance in number, and update this property afterwards. Why not make this supported internally with a percentage value?
So you can draw the pie with something like
plotOptions: {
pie: {
dataLabels: {
distance: 50%
}
}
},
With this, the labels will always be at the middle point of the radius, no matter how the pie chart is resized....
Live demo with steps to reproduce
Product version
Affected browser(s)
The text was updated successfully, but these errors were encountered: