Syncfusion Feedback

Trusted by the world’s leading companies

Syncfusion Trusted Companies

Overview

A chart communicates data graphically on a slide. The Syncfusion .NET PowerPoint Library allows you to create, remove, and customize 75+ types of charts in PowerPoint presentations using C#, without Microsoft PowerPoint or interop dependencies.

Create a chart in a PowerPoint presentation using C#

This example code shows how to create a chart in a presentation using the Syncfusion .NET PowerPoint Library with just a few lines of code in C#.

using Syncfusion.OfficeChart;
using Syncfusion.Presentation;
//Create an instance of presentation
using IPresentation presentation = Presentation.Create();
//Add a blank slide to the presentation
ISlide slide = presentation.Slides.Add(SlideLayoutType.Blank);
//Add a chart to the slide with position and size
IPresentationChart chart = slide.Charts.AddChart(100, 10, 700, 500);
//Select the chart type
chart.ChartType = OfficeChartType.Pie;
//Assign data range
chart.DataRange = chart.ChartData[1, 1, 6, 2];
chart.IsSeriesInRows = false;
//Set the values for the chart data
chart.ChartData.SetValue(1, 1, "Food");
chart.ChartData.SetValue(2, 1, "Fruits");
chart.ChartData.SetValue(3, 1, "Vegetables");
chart.ChartData.SetValue(4, 1, "Dairy");
chart.ChartData.SetValue(5, 1, "Protein");
chart.ChartData.SetValue(6, 1, "Grains");
chart.ChartData.SetValue(1, 2, "Percentage");
chart.ChartData.SetValue(2, 2, 36);
chart.ChartData.SetValue(3, 2, 14);
chart.ChartData.SetValue(4, 2, 13);
chart.ChartData.SetValue(5, 2, 28);
chart.ChartData.SetValue(6, 2, 9);
//Set data labels
chart.Series[0].DataPoints.DefaultDataPoint.DataLabels.IsValue = true;
//Save the presentation
using FileStream outputStream = new FileStream("Result.pptx", FileMode.Create, FileAccess.ReadWrite);
presentation.Save(outputStream);

Key features of PowerPoint charts

Chart title

Modify the chart title by changing its text, appearance, size, and more.

Chart area and plot area

Enhance the chart area and plot area by adjusting borders, colors, transparency; adding images; changing positions; and more.

Series

Customize a chart series by adjusting its name, type, color, borders; adding space between bars; and formatting markers.

Data labels

Adjust the chart’s data labels by changing their positions, sizes, and more.

Legend

Customize the chart legend by modifying its position, border, and legend entries.

Horizontal and vertical axes

Customize the horizontal and vertical axes of a chart by modifying their titles, borders, fonts, rotation angles, and more.

Explore chart references

Discover valuable resources from our knowledge base to enhance your use of charts in the PowerPoint Library:

Create a chart in PowerPoint and save it as an image

Knowledge base

How to create a chart in PowerPoint and save it as an image using C#

How to change the slice color of a pie chart

Knowledge base

How to change the slice color of a pie chart in PowerPoint using C#

How to modify data label text inside a chart

Knowledge base

How to modify data label text inside a chart in PowerPoint using C#

How to remove the legend from a chart in PowerPoint

Knowledge base

How to remove the legend from a chart in PowerPoint using C#

Syncfusion .NET PowerPoint Library Resources

Explore these resources for comprehensive guides, knowledge base articles, insightful blogs, and ebooks.

Frequently Asked Questions

Yes, apart from creating a chart from scratch, you can also create one from Excel data using the .NET PowerPoint Library, without needing Microsoft Office.

Yes, you can export specific charts within a PowerPoint presentation as individual images programmatically using the .NET PowerPoint Library in C#.

Yes, you can import data from various external sources into a chart programmatically using the .NET PowerPoint Library.

Yes, the .NET PowerPoint Library allows you to customize various chart elements such as the title, plot area, series, legends, data labels, and axes.

Yes, the .NET PowerPoint Library supports creating advanced charts such as funnel, box and whisker, waterfall, histogram, and Pareto charts programmatically using C#.

You can access this feature through the Syncfusion.Presentation.Net.Core NuGet package. Detailed code samples and a video tutorial are available in the documentation.

Our Customers Love Us

Having an excellent set of tools and a great support team, Syncfusion® reduces customers’ development time.
Here are some of their experiences.

Rated by users across the globe

Want to create, View, and edit PPT files in C# or VB.NET?

Start a free 30-day evaluation today!
DOWNLOAD FREE TRIAL

No credit card required.

Mobile Free Evaluation Section

Awards

Greatness—it’s one thing to say you have it, but it means more when others recognize it. Syncfusion® is proud to hold the following industry awards.

Scroll up icon