2012-09-21 123 views

回答

0

试试看看这个代码。它适用于我:

'labelFormatter':function() { 
     var total = 0, percentage; 
     $.each(this.series.data, function() { 
      total+=this.y; 
     }); 

     percentage=((this.y/total)*100).toFixed(1); 
     return this.name+' '+percentage+'%'; 
    } 
4

其令人惊讶的容易。在您的工具提示或dataLabels部分中更改您的格式。

FROM: 
    format: '<b>{point.name}</b>: {point.y:.1f} Rs.', 
TO: 
    format: '<b>{point.name}</b>: {point.percentage:.1f} %',