This short topic guides how to make a pie chart in PowerPoint using Python along with the detailed steps to configure the environment and use the example code. You can create pie chart in PowerPoint using Python using a few of lines of easy to use code, however you may modify it to add more details according to your requirements and save it on the disk in PPTX or PPT format.
Steps to Make a Pie Chart in PowerPoint using Python
- Set up the development environment to use Aspose.Slides for Python via .NET in your application
- Import aspose.slides namespace in your application
- Create an empty PowerPoint presentation using the Presentation class object to add a Pie chart in the presentation
- Access the default first default slide in the presentation
- Insert a chart shape with Pie chart as its type
- Set the chart parameters having default data series and categories
- Save the created presentation with pie chart on the disk
The aforementioned steps describe how to make a chart in PowerPoint using Python, whereby the process initiates by creating an empty presentation using the Presentation class object and accessing the default first slide. Then a chart shape is added with a PIE as chart type along with setting of different chart options. Finally, the presentation is saved on the disk in PPTX format using the save method.
Code to Create Pie Chart in PowerPoint using Python
This code exhibits how to make a graph in PowerPoint using Python, whereby pie chart type is used. The API offers to add all charts supported in MS PowerPoint including Column3D, ClusteredColumn, Line, Area, Contour, Bubble, Radar, etc. You can have a complete control over chart data within a chart using series and categories, series data points, chart title, formatting, sidewall, rotation, plot area, etc.
In this tutorial, we focused on how to create a pie chart in PowerPoint using Python. If you want to convert presentation to Tiff image, refer to the article on how to convert PowerPoint to Tiff using Python.