# Customize Doughnut Charts in Presentations Using JavaScript

> Discover how to create and customize doughnut charts with JavaScript and Aspose.Slides for Node.js, supporting PowerPoint formats for dynamic presentations.

Source: https://docs.aspose.com/slides/nodejs-java/doughnut-chart/
Updated: 2026-08-05


## **Overview**

This article shows how to work with a doughnut chart in Aspose.Slides by adding the chart to a slide, setting the size of its center hole, and saving the presentation. It focuses on the `setDoughnutHoleSize` method and demonstrates the basic steps required to customize this chart type in code.

It also includes a short FAQ covering related doughnut-chart scenarios, such as using multiple series to create multiple rings, working with exploded doughnut charts, and exporting a chart as a raster image or SVG.

## **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](https://reference.aspose.com/slides/nodejs-java/aspose.slides/presentation) object.
1. Add doughnut chart on the slide.
1. Specify the size of the hole in a doughnut chart.
1. Write presentation to disk.

In the example given below, we have set the size of the hole in a doughnut chart.

```javascript
var aspose = aspose || {};
aspose.slides = require("aspose.slides.via.java");
const java = require("java");

// 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(java.newByte(90));
    // Write presentation to disk
    pres.save("DoughnutHoleSize_out.pptx", aspose.slides.SaveFormat.Pptx);
} finally {
    if (pres != null) {
        pres.dispose();
    }
}
```

## **FAQ**

### Can I create a multi-level doughnut with multiple rings?

Yes. Add multiple series to a single doughnut chart—each series becomes a separate ring. The ring order is determined by the order of the series in the collection.

### Is an "exploded" doughnut (separated slices) supported?

Yes. There is an Exploded Doughnut [chart type](https://reference.aspose.com/slides/nodejs-java/aspose.slides/charttype/) and an explosion property on data points; you can separate individual slices.

### How can I get an image of a doughnut chart (PNG/SVG) for a report?

A chart is a shape; you can render it to a [raster image](https://reference.aspose.com/slides/nodejs-java/aspose.slides/shape/#getImage) or export the chart to an [SVG image](https://reference.aspose.com/slides/nodejs-java/aspose.slides/shape/writeassvg/).

