Reputation: 312
I'm trying to use labelFormat in my Highcharts Pie chart to add the y value of my series to the legend name. I haven't been able to. My question is very similar to this one, except I want the actual y value instead of a percentage. Thank you for your time.
Here's what I have so far, except I don't want percentage. I want the actual value:
legend: {
labelFormat: '{name} ({percentage:.0f})',
},
Upvotes: 0
Views: 1347
Reputation: 11633
Try to use this code instead, where 2f
is a number of decimals value:
Demo: https://jsfiddle.net/BlackLabel/ukc1tf3p/
legend: {
labelFormat: '{name} {y:.2f}',
},
API: https://www.highcharts.com/docs/chart-concepts/labels-and-string-formatting#format-strings
Upvotes: 1