Chart Data and Categories Manipulation within PowerPoint presentation

Charts in PowerPoint presentation

The charts provide us a quick and concise mechanism to present the statistical data and enable the relevant stakeholders to make key decisions quickly. As the charts are comprised of data and their respective categories, so operations like add, update, and deletion of chart data and its related categories can be carried out using Aspose.Slides Cloud API.

Working with Chart Categories

The new resource is a subresource of shape. It works only for Chart shapes that support categories (column, line, etc.) and allows us to add, modify & delete chart categories together with relevant data points.

Add a category to Chart

Request URL

<code>POST https://api.aspose.cloud/v3.0/slides/myPresentaion.pptx/slides/1/shapes/1/categories?folder=myFolder</code>

C#.NET

Update chart category

Request URL

<code>PUT https://api.aspose.cloud/v3.0/slides/myPresentaion.pptx/slides/1/shapes/1/categories/2?folder=myFolder</code>

C#.NET

Delete Chart Category

The Aspose.Slides Cloud API also offers the capabilities to delete any existing category in chart object. You simply need to provide the index of Slide, respective shape index, and the related category ID to fulfill the requirements.

Request URL

<code>DELETE https://api.aspose.cloud/v3.0/slides/myPresentaion.pptx/slides/1/shapes/1/categories/2?folder=myFolder</code>

C#.NET

Working with Charts data

The API is fully capable of providing features to manipulate data points related to chart objects within PowerPoint slides. As per recent changes in API, the new resource is a subresource of series. It works only for Chart shapes and allows us to add, modify & delete individual data points.

Add a data point to a chart series

This works with scatter & bubble series. You cannot create a data point for a one-value series without creating a relevant category.

Request URL

<code>POST https://api.aspose.cloud/v3.0/slides/myPresentaion.pptx/slides/1/shapes/1/series/2/dataPoints?folder=myFolder</code>

C#.NET

Update chart data point

You may also use the API to update the existing chart data points.

Request URL

<code>PUT https://api.aspose.cloud/v3.0/slides/myPresentaion.pptx/slides/1/shapes/1/series/2/dataPoints/2?folder=myFolder</code>

C#.NET

Delete chart data point

For all the existing data points within the Chart object, the API also enables you to delete any point by providing value for PointIndex.

Request URL

<code>DELETE https://api.aspose.cloud/v3.0/slides/myPresentaion.pptx/slides/1/shapes/1/series/2/dataPoints/2?folder=myFolder</code>

C#.NET