Free Support Forum -

The color of the pie chart sector


I need to set the color of the pie chart sector. I tried the Points Colection, but it is empty.



Ondrej Lukes

Hi Ondrej,

Please accept my apologies for this much delayed response. I have worked over the requirements shared by you and regret to share that presently the requested feature is unavailable in Aspose.Slides. I have created an issue with ID SLIDESNET-33589 in our issue tracking system to further investigate and resolve the issue. In my opinion, once the issue will be resolved, following code snippet will be used to serve the purpose.
PresentationEx pres = new PresentationEx();
SlideEx sld = pres.Slides[0];
Aspose.Slides.Pptx.ChartEx chart = sld.Shapes.AddChart(ChartTypeEx.Pie, 100, 100, 400, 400);
ChartDataCellFactory fact = chart.ChartData.ChartDataCellFactory;
//Adding new categories
chart.ChartData.Categories.Add(fact.GetCell(0, 1, 0, "First Qtr"));
chart.ChartData.Categories.Add(fact.GetCell(0, 2, 0, "2nd Qtr"));
chart.ChartData.Categories.Add(fact.GetCell(0, 3, 0, "3rd Qtr"));
chart.ChartData.Series.Add(fact.GetCell(0, 0, 1, "Series 1"), chart.Type);
ChartSeriesEx series = chart.ChartData.Series[0];
series.Values.Add(fact.GetCell(0, 1, 1, 20));
series.Values.Add(fact.GetCell(0, 2, 1, 50));
series.Values.Add(fact.GetCell(0, 3, 1, 30));
series.IsColorVaried = true;
ChartPointEx point = new ChartPointEx(series);
point.Index = 1;
point.Format.Fill.FillType = FillTypeEx.Solid;
point.Format.Fill.SolidFillColor.Color = Color.Cyan;
ChartPointEx point1 = new ChartPointEx(series);
point1.Index = 1;
point1.Format.Fill.FillType = FillTypeEx.Solid;
point1.Format.Fill.SolidFillColor.Color = Color.Brown;
ChartPointEx point2 = new ChartPointEx(series);
point2.Index = 2;
point2.Format.Fill.FillType = FillTypeEx.Solid;
point2.Format.Fill.SolidFillColor.Color = Color.DarkGreen;

// Save presentation with chart
pres.Write(@"D:\Aspose Data\AsposeChart.pptx");

I will share the further response with you as soon as the issue will be resolved.

We are sorry for your inconvenience,

Hi Mudassir,

i need know, when the issue will be resolved? This feature is crucial for my project.

Thanks Ondrej Lukes

Hi Ondrej,

I have discussed the issue with our development team and like to share that the issue has been scheduled for investigation during week 38 of 2012. We will share the further information with you as soon as it will be resolved by our development team.

Many Thanks,

Hi Ondrej,

I like to share that feature for setting the pie chart color has been added in Aspose.Slides for .NET 6.7.0. Please visit this documentation link for your kind reference. We will share the notification with you once Aspose.Slides for .NET 6.7.0 will be made available by tonight.

Many Thanks,

The issues you have found earlier (filed as SLIDESNET-33589) have been fixed in this update.

This message was posted using Notification2Forum from Downloads module by aspose.notifier.