Hi,
I have another problem with your product.
I can not to show the percentage in my Pie3D chart. In the DataLabels collection, I do not have any data, it’s empty (no null, but empty).
How can I do ?
Thanks for your answer.
Alida
Hi Alida,
Hello, You will find in attachment, the chart expected.
Thanks.
Alida
Hi Alida,
DocumentBuilder builder = new DocumentBuilder(doc);
Shape shape = builder.InsertChart(ChartType.Pie, 432, 252);
Chart chart = shape.Chart;
ChartSeriesCollection seriesColl = chart.Series;
seriesColl.Clear();
string[] categories = new string[] { "Grapefruit", "Oranges", "Plums", "Pears", "Apples" };
// Specify all values as 20%
ChartSeries series = seriesColl.Add("Imported Fruits", categories, new double[] { 2, 2, 2, 2, 2 });
ChartDataLabelCollection dataLabelCollection = series.DataLabels;
ChartDataLabel chartDataLabel00 = dataLabelCollection.Add(0);
ChartDataLabel chartDataLabel01 = dataLabelCollection.Add(1);
ChartDataLabel chartDataLabel02 = dataLabelCollection.Add(2);
ChartDataLabel chartDataLabel03 = dataLabelCollection.Add(3);
ChartDataLabel chartDataLabel04 = dataLabelCollection.Add(4);
chartDataLabel00.ShowCategoryName = true;
chartDataLabel01.ShowCategoryName = true;
chartDataLabel02.ShowCategoryName = true;
chartDataLabel03.ShowCategoryName = true;
chartDataLabel04.ShowCategoryName = true;
chart.Legend.Position = LegendPosition.Left;
doc.Save(MyDir + @"15.9.0.docx");