Charts in PowerPoint presentation

The charts provide us a quick and concise mechanism to present the statistical data. It enables the relevant stakeholders to make key decisions quickly. The charts are comprised of data and their respective categories. So the operations like add, update, and deleting chart data in PowerPoint. Its related categories can also be carried out using Aspose.Slides Cloud API.

Furthermore, in order to use the SDK, you need to install it and the easiest way is through the NuGet library. So, please try using the following command on the Package Manager console

 Install-Package Aspose.Slides-Cloud -Version 21.2.0

The Cloud API can also be accessed using cURL commands over the terminal. So, in order to access them, you need to provide a JWT token which is generated based on your Client ID and Client Secret. Therefore, we recommend you to visit the following links for further understanding about

Working with Chart Categories

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

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 objects. 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 the PowerPoint slides. As per recent updates 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 the 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