We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

Showing percentages on bar chart relative to maximum value

Hi There,

I would like to show percentages on chart relative to the maximum value, not the actual value itself. Is there a way to achieve that through API or I need to calculate percentages and then use style 9 to show percentage sign there?

Best Regards,


Well, you may try DataLabels.setShowPercentage() method for your needs, see the sample lines of code for your reference:
Sample code:

DataLabels dataLabels = chart.getNSeries().get(0).getDataLabels();

Other way can be change the source data/values (in the cells) for percentage, and then use DataLabels.NumberFormat attribute to specify the percentage formatting string.

Hope, this helps a bit.