Doughnut Chart
Contents
[
Hide
]
Change Center Gap in Doughnut Chart
Aspose.Slides for Java now supports specifying the size of the hole in a doughnut chart. In this topic, we will see with example how to specify the size of the hole in a doughnut chart.
In order to specify the size of the hole in a doughnut chart, please follow the steps below:
- Instantiate Presentation object.
- Add doughnut chart on the slide.
- Specify the size of the hole in a doughnut chart.
- Write presentation to disk.
In the example given below, we have set the size of the hole in a doughnut chart.
// Create an instance of Presentation class
Presentation pres = new Presentation();
try {
IChart chart = pres.getSlides().get_Item(0).getShapes().addChart(ChartType.Doughnut, 50, 50, 400, 400);
chart.getChartData().getSeriesGroups().get_Item(0).setDoughnutHoleSize((byte)90);
// Write presentation to disk
pres.save("DoughnutHoleSize_out.pptx", SaveFormat.Pptx);
} finally {
if (pres != null) pres.dispose();
}