Dear,
Using ASPose.slide v 7.1 I am trying to crate a .pptx presentation with “Stacked Con” chart. The generated chart has “Box” as shape for the series, how can I change that to “Full Cone” shape. I have uploaded “Cone Chart.png” screenshot for your reference.
Bellow is the code I am using:
private void CreateConeSlide()
{
SlideEx sld = pres.Slides[0];
Aspose.Slides.Pptx.ChartEx lChart = sld.Shapes.AddChart(ChartTypeEx.StackedCone, 0, 0, 300, 300);
lChart.HasLegend = false;
lChart.ValueAxis.IsVisible = false;
lChart.ValueAxis.MajorGridLines.FillFormat.FillType = FillTypeEx.NoFill;
lChart.CategoryAxis.IsVisible = false;
lChart.ValueAxis.IsPlotOrderReversed = true;
lChart.Rotation3D.RotationY = 0;
lChart.Rotation3D.RotationX = 0;
lChart.Rotation3D.RightAngleAxes = true;
lChart.Floor.Format.Fill.FillType = FillTypeEx.NoFill;
lChart.Floor.Format.Line.FillFormat.FillType = FillTypeEx.NoFill;
lChart.HasLegend = false;
lChart.HasTitle = false;
lChart.ChartData.Series.Clear();
lChart.ChartData.Categories.Clear();
ChartDataCellFactory fact = lChart.ChartData.ChartDataCellFactory;
lChart.ChartData.Series.Add(fact.GetCell(0, 0, 1, “S1”), lChart.Type);
lChart.ChartData.Series.Add(fact.GetCell(0, 0, 2, “S2”), lChart.Type);
lChart.ChartData.Series.Add(fact.GetCell(0, 0, 3, “S3”), lChart.Type);
lChart.ChartData.Series.Add(fact.GetCell(0, 0, 4, “S4”), lChart.Type);
lChart.ChartData.Categories.Add(fact.GetCell(0, 1, 0, “C - 1”));
ChartSeriesEx series = lChart.ChartData.Series[0];
series.Format.Fill.FillType = FillTypeEx.Solid;
series.Format.Fill.SolidFillColor.Color = Color.Red;
series.Format.Line.FillFormat.FillType = FillTypeEx.Solid;
series.Format.Line.FillFormat.SolidFillColor.Color = Color.White;
series.Format.Line.Width = 5;
series.Labels.ShowValue = true;
series.Values.Add(fact.GetCell(0, 1, 1, 20));
series = lChart.ChartData.Series[1];
series.Format.Fill.FillType = FillTypeEx.Solid;
series.Format.Fill.SolidFillColor.Color = Color.Blue;
series.Format.Line.FillFormat.FillType = FillTypeEx.Solid;
series.Format.Line.FillFormat.SolidFillColor.Color = Color.White;
series.Format.Line.Width = 5;
series.Labels.ShowValue = true;
series.Values.Add(fact.GetCell(0, 1, 2, 10));
series = lChart.ChartData.Series[2];
series.Format.Fill.FillType = FillTypeEx.Solid;
series.Format.Fill.SolidFillColor.Color = Color.Yellow;
series.Format.Line.FillFormat.FillType = FillTypeEx.Solid;
series.Format.Line.FillFormat.SolidFillColor.Color = Color.White;
series.Format.Line.Width = 5;
series.Labels.ShowValue = true;
series.Values.Add(fact.GetCell(0, 1, 3, 15));
series = lChart.ChartData.Series[3];
series.Format.Fill.FillType = FillTypeEx.Solid;
series.Format.Fill.SolidFillColor.Color = Color.Green;
series.Format.Line.FillFormat.FillType = FillTypeEx.Solid;
series.Format.Line.FillFormat.SolidFillColor.Color = Color.White;
series.Format.Line.Width = 5;
series.Labels.ShowValue = true;
series.Values.Add(fact.GetCell(0, 1, 4, 18));
}
Thank you in advance,
Sami Simon