Percentage in pie legend
Lots of pie charts have the percentage value next to the name in the legend. Today you can only get the name and y-value in the legend's labelFormatter. It would be really great if you could add percentage as well, like the tooltip's formatter.
Completed: http://jsfiddle.net/highcharts/9wXvr/
-
Anonymous commented
You can use next labelFormatter function
function () {
var total = 0, percentage;
$.each(this.series.data, function() {
total+=this.y;
});
percentage=((this.y/total)*100).toFixed(2);
return '<span style="color:'+this.color+'">'+percentage+'</span>'+ this.name;
}