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

Free Support Forum - aspose.com

How to add label leader lines to an doughnut chart in PPT

Hi,


I am using the below code to create a doughnut chart in PPT. Please see the attached image for the output of this code. To avoid overlapping issue, I need to display text out side of the label by pointing with leader lines.

Please let me know the workable solution.

p.p1 {margin: 0.0px 0.0px 0.0px 0.0px; font: 17.0px Monaco} span.s1 {color: #7e504f} span.s2 {color: #3933ff}

/*

* Purpose: Chart type and Most of the customization is defined using MSO in PPt slide.

* This class provides a way to dynamically populate data only.

*

*/

public class DrawChart {


// Draw any type of chart - Pie, Doughnut, Area, Bar

// Categories as defined in the template, Series =1

public static IChart drawChart(IChart chart, List dataPoints) {


for (int i = 0; i chart.getChartData().getCategories().size(); i++) {

chart.getChartData().getSeries().get_Item(0).getDataPoints().get_Item(i).getValue()

.setData(dataPoints.get(i));

}

return chart;

}


p.p1 {margin: 0.0px 0.0px 0.0px 0.0px; font: 17.0px Monaco; color: #4e9072} p.p2 {margin: 0.0px 0.0px 0.0px 0.0px; font: 17.0px Monaco} p.p3 {margin: 0.0px 0.0px 0.0px 0.0px; font: 17.0px Monaco; min-height: 22.0px} p.p4 {margin: 0.0px 0.0px 0.0px 0.0px; font: 17.0px Monaco; color: #931a68} span.s1 {color: #931a68} span.s2 {color: #000000} span.s3 {color: #7e504f} span.Apple-tab-span {white-space:pre}

}

p.p1 {margin: 0.0px 0.0px 0.0px 0.0px; font: 17.0px Monaco} span.s1 {color: #7e504f} span.s2 {color: #4e9072} span.s3 {text-decoration: underline ; color: #4e9072} span.Apple-tab-span {white-space:pre}

Hi Shruti,


I have observed your comments. I have shared piece of code this will help you to achieve requirements. Please share feedback with us if there is still an issue.


chart.ChartData.Series[0].Labels[i].AsILayoutable.X

chart.ChartData.Series[0].Labels[i].AsILayoutable.Y

Best Regards,