Colors for pie chart

Hi,

I am using pie chart and i want to set a range of colors which should be automatically picked up by chart based on the number of sectors created.

Is that possible?

I know it can be achieved by applying color to each sector but i want to specify it on chart level and not sector level.

@siddhanntarora,

I have observed the requirements shared by you and like to share that Aspose.Slides allows you to set the custom series fill color as well as selecting automatic series color (governed by theme) for chart series. In order to set the automatic series color, I suggest you to please visit documentation article, setting automatic series fill color.

@mudassir.fayyaz,
The series fill color is not working for a pie chart and i dont want to apply the color automatically from theme but to have custom color pattern for my pie chart.

Also, i dont want to specify color for each sector.

@siddhanntarora,

I suggest you to please visit the following two documentation articles for your kind reference. As mentioned earlier, either you can set the custom color for pie chart sector or use automatic fill color from theme.

I hope the shared documentation articles will be helpful.

Hi, I’m interested in the second topic (Setting automatic pie chart slice colors), but the link doesn’t work. It is linked to a page with a table of content, but I didn’t find that topic.

Is there a way to automatically set pie chart colors?

@kylanee,
Welcome to our community! Thank you for your query. You can set colors for pie chart slices automatically as below.

C#

series.ParentSeriesGroup.IsColorVaried = true;

Documentation: Set Automatic Pie Chart Slice Colors
API Reference: ChartSeriesGroup.IsColorVaried Property

Java

series.getParentSeriesGroup().setColorVaried(true);

Documentation: Set Automatic Pie Chart Slice Colors
API Reference: ChartSeriesGroup.setColorVaried method

1 Like

It worked, thank you very much!