Doughnut Chart
Contents
[
Hide
]
Change Center Gap in Doughnut Chart
Aspose.Slides for Node.js via 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
var pres = new aspose.slides.Presentation();
try {
var chart = pres.getSlides().get_Item(0).getShapes().addChart(aspose.slides.ChartType.Doughnut, 50, 50, 400, 400);
chart.getChartData().getSeriesGroups().get_Item(0).setDoughnutHoleSize(90);
// Write presentation to disk
pres.save("DoughnutHoleSize_out.pptx", aspose.slides.SaveFormat.Pptx);
} finally {
if (pres != null) {
pres.dispose();
}
}