Doughnut Chart

Change Center Gap in Doughnut Chart

In order to specify the size of the hole in a doughnut chart, please follow the steps below:

  1. Instantiate Presentation object.
  2. Add doughnut chart on the slide.
  3. Specify the size of the hole in a doughnut chart.
  4. 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();
}