This article guides on how to create bar chart in PowerPoint with C# REST API. You will learn how to create a bar graph in PowerPoint with C# RESTful Service using a .NET-based Cloud SDK. It contains complete information on adding a chart and setting data.
Prerequisite
- Create an account API credentials
- Download Aspose.Slides Cloud SDK for Dotnet to add a chart
- Setup C# project with the above SDK to work with graphs in a presentation
Steps to Add Column Chart in PowerPoint with C# .NET-based API
- Initialize the SlidesApi with a client ID and secret for adding a chart
- Upload the presentation file to the Cloud
- Create a new chart configuration object using the Chart class and set the chart type
- Add chart title and initialize categories for the chart
- Initialize the data series for the chart, create the data series, and add the first data series
- Initialize more data series for the chart if required
- Add the chart to the first slide of the presentation using the CreateShape() method and download it if required
These steps describe how to create bar chart in PowerPoint with C# .NET-based API. Create the SlidesApi object, upload the presentation, create a Chart object, set chart type, position, dimensions, title, categories and desired data series. Add the data series to the chart and add the chart to the first slide.
Code to Create Bar Graph in PowerPoint with C# REST Interface
This code demonstrates the process of how to make a bar graph in PowerPoint with C# Low Code API. You may set different chart type such as ClusteredColumn, Column3D, ClusteredCone, and Line etc, using the ChartTypeEnum and other parameters in the Chart object including ShowDataLabelsOverMaximum, BackWall, SideWall, Floor, and Legend etc.
This article has taught us the creation of a bar chart in PowerPoint. To convert HTML to PowerPoint, refer to the article on Convert HTML to PowerPoint with NET REST API.