IChartDataPointExplosion Property
Specifies the amount the data point shall be moved from the center of the pie. Can be negative, negative means that property is not set and no explosion should be applied. Applies only to Pie charts.

Namespace: Aspose.Words.Drawing.Charts
Assembly: Aspose.Words (in Aspose.Words.dll) Version: 20.1
int Explosion { get; set; }

Property Value

Type: Int32
Shows how to manipulate the position of the portions of a pie chart.
Document doc = new Document();
DocumentBuilder builder = new DocumentBuilder(doc);

Shape shape = builder.InsertChart(ChartType.Pie, 500, 350);
Chart chart = shape.Chart;

// In a pie chart, the portions are the data points, which cannot have markers or sizes applied to them
// However, we can set this variable to move any individual "slice" away from the center of the chart
ChartDataPoint cdp = chart.Series[0].DataPoints.Add(0);
cdp.Explosion = 10;

cdp = chart.Series[0].DataPoints.Add(1);
cdp.Explosion = 40;

doc.Save(ArtifactsDir + "Charts.PieChartExplosion.docx");
See Also