Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

support assign a percentage to series.pie.dataLabels.distance property #8854

Closed
DongShi opened this issue Aug 29, 2018 · 1 comment
Closed
Assignees

Comments

@DongShi
Copy link

DongShi commented Aug 29, 2018

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)

@pawelfus
Copy link
Contributor

Hi @DongShi

Thank you for your suggestion! Actually it's already reported on our UserVoice: https://highcharts.uservoice.com/forums/55896-highcharts-javascript-api/suggestions/3072785-pie-label-distance-as-percentage-of-pie-size - please vote for this feature

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants