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

Free Support Forum - aspose.com

Unable to change colour of Data Label Text in Donut Chart

Hi,

I am using Aspose.Slides for Java (version 17.8).
I am unable to set the ecolour for Data Label.
Chart Type is Donut.

The codee is below:

chart.getChartData().getSeries().get_Item(0).getLabels().getDefaultDataLabelFormat()
            .getTextFormat().getPortionFormat().getFillFormat().getSolidFillColor()
            .setColor(Color.WHITE);

Please let me if this is the correct way to do it. If it is correct, what is being missed? If not, what is the alternative way?

@siddharth_zapr_in,

I have observed your comments. Can you please share source presentation and complete sample project so that we may further investigate to help you out.

Hi @Adnan.Ahmad,

Thanks for your time. I figured out the issue. I had to set Fill Type as Solid.
Added this snippet and it worked fine.

chart.getChartData().getSeries().get_Item(0).getLabels().getDefaultDataLabelFormat()
            .getTextFormat().getPortionFormat().getFillFormat().setFillType(FillType.Solid);

@siddharth_zapr_in,

We are glad to know that things started working on your own. Please share feedback with us if there is still an issue.