0
votes

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})',
    },
1

1 Answers

1
votes

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