I am trying to figure out if it is possible to display the percentage for each pie item inside the actual pie item for highcharts? Example of what I mean is something like this:
https://developers.google.com/chart/interactive/docs/gallery/piechart
log(this) return Math. round(this. percentage)+'%'; } }, series: [{ type: 'column', data: [29.9, 71.5, 106.4, 129.2, 144.0, 176.0, 135.6, 148.5, 216.4, 194.1, 95.6, 54.4], name: 'Temperature' },] }); Now, on mouse over it returns "NaN%", can you tell me why it is like that or how to fix it?
To display percentage values as labels on a pie chart The data labels should appear within each slice on the pie chart. On the design surface, right-click on the labels and select Series Label Properties. The Series Label Properties dialog box appears. Type #PERCENT for the Label data option.
Percentages are calculated by using the equation amount / total = percentage. For example, if a cell contains the formula =10/100, the result of that calculation is 0.1. If you then format 0.1 as a percentage, the number will be correctly displayed as 10%.
You may want to look @ dataLabels.formatter
. this.percentage
option is available for pie
Also dataLabels.distance
can be set to a negative value for dataLabels inside the pie.
Pie with percentage values inside @ jsFiddle
Its suprisingly easy. In your tooltip or dataLabels section change your format.
FROM:
format: '<b>{point.name}</b>: {point.y:.1f} Rs.',
TO:
format: '<b>{point.name}</b>: {point.percentage:.1f} %',
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With