Skip to content

Commit 52653d4

Browse files
Add charts examples
1 parent 1699abc commit 52653d4

File tree

78 files changed

+3828
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

78 files changed

+3828
-0
lines changed

slides/english/_index.md

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,22 @@ Embark on a journey of expertise with our Aspose.Slides for .NET tutorials, desi
2222

2323
{{% /alert %}}
2424

25+
{{< /blocks/products/pf/tutorial-page-section >}}
26+
{{< blocks/products/pf/tutorial-page-section >}}
27+
## [Master Chart Creation with Aspose.Slides for .NET](./net/charts/)
28+
Learn how to create and manipulate powerful charts in PowerPoint presentations using Aspose.Slides for .NET. Complete tutorials for developers of all skill levels.
29+
30+
{{< tutorial-card link="./net/charts/change-color-of-categories/" title="Customize Chart Data Point Colors in PowerPoint with Aspose.Slides" imgSrc="./net/charts/change-color-of-categories/images/thumb.png" >}}
31+
{{< tutorial-card link="./net/charts/chart-marker-options-on-data-point/" title="Custom Image Markers in PowerPoint Line Charts with Aspose.Slides" imgSrc="./net/charts/chart-marker-options-on-data-point/images/thumb.png" >}}
32+
{{< tutorial-card link="./net/charts/chart-trend-lines/" title="Add Trend Lines to PowerPoint Charts Using Aspose.Slides" imgSrc="./net/charts/chart-trend-lines/images/thumb.png" >}}
33+
{{< tutorial-card link="./net/charts/existing-chart/" title="Modifying Charts in PowerPoint with Aspose.Slides" imgSrc="./net/charts/existing-chart/images/thumb.png" >}}
34+
{{< tutorial-card link="./net/charts/multi-category-chart/" title="Creating Clustered Column Charts with Aspose.Slides" imgSrc="./net/charts/multi-category-chart/images/thumb.png" >}}
35+
{{< tutorial-card link="./net/charts/normal-charts/" title="Creating Custom Column Charts with Aspose.Slides for .NET" imgSrc="./net/charts/normal-charts/images/thumb.png" >}}
36+
{{< tutorial-card link="./net/charts/pie-chart/" title="Create a Pie Chart in PowerPoint Using Aspose.Slides" imgSrc="./net/charts/pie-chart/images/thumb.png" >}}
37+
{{< tutorial-card link="./net/charts/tree-map-chart/" title="Create a Treemap Chart in PowerPoint using Aspose.Slides" imgSrc="./net/charts/tree-map-chart/images/thumb.png" >}}
38+
{{< /blocks/products/pf/tutorial-page-section >}}
39+
40+
{{< blocks/products/pf/tutorial-page-section >}}
2541
These are links to some useful resources:
2642
- [Presentation Conversion](./net/presentation-conversion/)
2743
- [Presentation Manipulation](./net/presentation-manipulation/)

slides/english/net/_index.md

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,22 @@ Dive into the world of presentation conversion with Aspose.Slides for .NET. Lear
2020
## Presentation Manipulation: Unveiling the Magic of Dynamic Presentations
2121
Unleash your creativity and efficiency in presentation manipulation using Aspose.Slides for .NET. Explore tutorials that walk you through the process of dynamically creating, modifying, and enhancing PowerPoint presentations programmatically. From managing slide layouts and content to incorporating animations and multimedia, these tutorials equip you with the skills to craft engaging and interactive presentations that captivate your audience.
2222

23+
{{< /blocks/products/pf/tutorial-page-section >}}
24+
{{< blocks/products/pf/tutorial-page-section >}}
25+
## [Master Chart Creation with Aspose.Slides for .NET](./charts/)
26+
Learn how to create and manipulate powerful charts in PowerPoint presentations using Aspose.Slides for .NET. Complete tutorials for developers of all skill levels.
27+
28+
{{< tutorial-card link="./charts/change-color-of-categories/" title="Customize Chart Data Point Colors in PowerPoint with Aspose.Slides" imgSrc="./charts/change-color-of-categories/images/thumb.png" >}}
29+
{{< tutorial-card link="./charts/chart-marker-options-on-data-point/" title="Custom Image Markers in PowerPoint Line Charts with Aspose.Slides" imgSrc="./charts/chart-marker-options-on-data-point/images/thumb.png" >}}
30+
{{< tutorial-card link="./charts/chart-trend-lines/" title="Add Trend Lines to PowerPoint Charts Using Aspose.Slides" imgSrc="./charts/chart-trend-lines/images/thumb.png" >}}
31+
{{< tutorial-card link="./charts/existing-chart/" title="Modifying Charts in PowerPoint with Aspose.Slides" imgSrc="./charts/existing-chart/images/thumb.png" >}}
32+
{{< tutorial-card link="./charts/multi-category-chart/" title="Creating Clustered Column Charts with Aspose.Slides" imgSrc="./charts/multi-category-chart/images/thumb.png" >}}
33+
{{< tutorial-card link="./charts/normal-charts/" title="Creating Custom Column Charts with Aspose.Slides for .NET" imgSrc="./charts/normal-charts/images/thumb.png" >}}
34+
{{< tutorial-card link="./charts/pie-chart/" title="Create a Pie Chart in PowerPoint Using Aspose.Slides" imgSrc="./charts/pie-chart/images/thumb.png" >}}
35+
{{< tutorial-card link="./charts/tree-map-chart/" title="Create a Treemap Chart in PowerPoint using Aspose.Slides" imgSrc="./charts/tree-map-chart/images/thumb.png" >}}
36+
{{< /blocks/products/pf/tutorial-page-section >}}
37+
38+
{{< blocks/products/pf/tutorial-page-section >}}
2339
## Aspose.Slides for .NET Tutorials
2440
### [Presentation Conversion](./presentation-conversion/)
2541
Elevate your skills with Aspose.Slides for .NET tutorials. Learn presentation conversion and PowerPoint processing step-by-step. Transform your workflow today!

slides/english/net/charts/_index.md

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
---
2+
title: Master Chart Creation with Aspose.Slides for .NET
3+
weight: 10
4+
limit:
5+
description: Learn how to create and manipulate powerful charts in PowerPoint presentations using Aspose.Slides for .NET. Complete tutorials for developers of all skill levels.
6+
keywords:
7+
url: /net/charts/
8+
---
9+
{{< blocks/products/pf/main-wrap-class >}}
10+
{{< blocks/products/pf/main-container >}}
11+
{{< blocks/products/pf/tutorial-page-section >}}
12+
13+
## Introduction
14+
15+
Aspose.Slides for .NET provides comprehensive support for creating and customizing charts in PowerPoint presentations. This tutorial series guides you through the process of working with various chart types, from basic bar and line charts to complex financial and statistical visualizations. Learn how to harness the full potential of Aspose.Slides' chart capabilities to transform your data into compelling visual stories.
16+
17+
Whether you're a beginner looking to create your first chart or an experienced developer seeking advanced customization techniques, these tutorials offer step-by-step instructions with practical examples. Explore how to format chart elements, update data sources, apply animations, and implement best practices for creating professional-quality charts that effectively communicate your data insights in PowerPoint presentations.
18+
19+
{{< tutorial-card link="./change-color-of-categories/" title="Customize Chart Data Point Colors in PowerPoint with Aspose.Slides" imgSrc="./change-color-of-categories/images/thumb.png" >}}
20+
{{< tutorial-card link="./chart-marker-options-on-data-point/" title="Custom Image Markers in PowerPoint Line Charts with Aspose.Slides" imgSrc="./chart-marker-options-on-data-point/images/thumb.png" >}}
21+
{{< tutorial-card link="./chart-trend-lines/" title="Add Trend Lines to PowerPoint Charts Using Aspose.Slides" imgSrc="./chart-trend-lines/images/thumb.png" >}}
22+
{{< tutorial-card link="./existing-chart/" title="Modifying Charts in PowerPoint with Aspose.Slides" imgSrc="./existing-chart/images/thumb.png" >}}
23+
{{< tutorial-card link="./multi-category-chart/" title="Creating Clustered Column Charts with Aspose.Slides" imgSrc="./multi-category-chart/images/thumb.png" >}}
24+
{{< tutorial-card link="./normal-charts/" title="Creating Custom Column Charts with Aspose.Slides for .NET" imgSrc="./normal-charts/images/thumb.png" >}}
25+
{{< tutorial-card link="./pie-chart/" title="Create a Pie Chart in PowerPoint Using Aspose.Slides" imgSrc="./pie-chart/images/thumb.png" >}}
26+
{{< tutorial-card link="./tree-map-chart/" title="Create a Treemap Chart in PowerPoint using Aspose.Slides" imgSrc="./tree-map-chart/images/thumb.png" >}}
27+
28+
{{< /blocks/products/pf/tutorial-page-section >}}
29+
{{< /blocks/products/pf/main-container >}}
30+
{{< /blocks/products/pf/main-wrap-class >}}
31+
32+
{{< blocks/products/products-backtop-button >}}
Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
---
2+
title: Customize Chart Data Point Colors in PowerPoint with Aspose.Slides for .NET
3+
weight: 7700
4+
limit:
5+
description: Learn how to create PowerPoint presentations with charts and customize individual data point colors using Aspose.Slides for .NET. This example demonstrates how to modify chart appearance programmatically.
6+
keywords: [Aspose.Slides, PowerPoint, .NET, C#, charts, data visualization, data point customization, charts in PowerPoint, presentations]
7+
url: /net/charts/change-color-of-categories/
8+
---
9+
{{< blocks/products/pf/main-wrap-class >}}
10+
{{< blocks/products/pf/main-container >}}
11+
{{< blocks/products/pf/tutorial-page-section >}}
12+
13+
# Customize Chart Data Point Colors in PowerPoint with Aspose.Slides
14+
15+
Aspose.Slides for .NET provides powerful capabilities for creating and manipulating PowerPoint presentations programmatically. This example demonstrates how to create a presentation with a chart, modify a data point's color, and save the result as a PowerPoint file. By customizing individual data points, you can highlight specific information within your charts to create more impactful presentations.
16+
17+
---
18+
{{< tutorial-widget sourcePath="slides/net/charts/change-color-of-categories" >}}
19+
20+
{{< /blocks/products/pf/tutorial-page-section >}}
21+
{{< blocks/products/pf/tutorial-page-section >}}
22+
## Installation Instructions
23+
24+
1. Install Aspose.Slides for .NET using one of the following methods:
25+
26+
- NuGet Package Manager:
27+
```
28+
Install-Package Aspose.Slides
29+
```
30+
31+
- Package Manager Console:
32+
```
33+
PM> Install-Package Aspose.Slides
34+
```
35+
36+
- .NET CLI:
37+
```
38+
dotnet add package Aspose.Slides
39+
```
40+
41+
2. Add references to the required namespaces in your C# file:
42+
```csharp
43+
using Aspose.Slides;
44+
using Aspose.Slides.Charts;
45+
using System.Drawing;
46+
```
47+
48+
3. Implement the example code shown below to customize your chart's data point colors.
49+
50+
## Documentation Links
51+
52+
- [Aspose.Slides for .NET Documentation](https://docs.aspose.com/slides/net/)
53+
- [Aspose.Slides for .NET API Reference](https://reference.aspose.com/slides/net/)
54+
{{< /blocks/products/pf/tutorial-page-section >}}
55+
{{< /blocks/products/pf/main-container >}}
56+
{{< /blocks/products/pf/main-wrap-class >}}
57+
58+
{{< blocks/products/products-backtop-button >}}
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
//ExStart
2+
//ExSummary: This code demonstrates how to create a PowerPoint presentation with a chart, modify a data point's fill color, and save the presentation as a .pptx file.
3+
//ExStepSummary:0:Initialize the data directory path and create a new presentation instance.
4+
//ExStepSummary:1:Add a clustered column chart to the first slide.
5+
//ExStepSummary:2:Access the first data point in the first series of the chart.
6+
//ExStepSummary:3:Modify the data point's fill type to solid and set its color to blue.
7+
//ExStepSummary:4:Save the presentation in .pptx format.
8+
//ExStepImage:1:images/1.png
9+
//ExStepImage:2:images/2.png
10+
//ExStepImage:3:images/3.png
11+
//ExStep:0-
12+
// Initialize the path to the documents directory
13+
string dataDir = "Your Document Directory";
14+
15+
//ExStep:1-
16+
// Create a new presentation instance
17+
using (Presentation pres = new Presentation())
18+
{
19+
// Add a clustered column chart to the first slide
20+
IChart chart = pres.Slides[0].Shapes.AddChart(ChartType.ClusteredColumn, 50, 50, 600, 400);
21+
22+
//ExStep:2-
23+
// Access the first data point in the first series of the chart
24+
IChartDataPoint point = chart.ChartData.Series[0].DataPoints[0];
25+
26+
//ExStep:3-
27+
// Modify the data point's fill type to solid and set its color to blue
28+
point.Format.Fill.FillType = FillType.Solid;
29+
point.Format.Fill.SolidFillColor.Color = Color.Blue;
30+
31+
//ExStep:4-
32+
// Save the presentation in .pptx format
33+
pres.Save(dataDir + "output.pptx", SaveFormat.Pptx);
34+
}
35+
//ExEnd
Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
---
2+
title: Custom Image Markers in PowerPoint Line Charts with Aspose.Slides for .NET
3+
weight: 7700
4+
limit:
5+
description: Create professional PowerPoint presentations with custom image markers in line charts using Aspose.Slides for .NET. This powerful API enables developers to programmatically add and modify.
6+
keywords: [Aspose.Slides, .NET, PowerPoint, Line Charts, Custom Markers, Image Markers, Data Visualization, C#, Chart Customization]
7+
url: /net/charts/chart-marker-options-on-data-point/
8+
---
9+
{{< blocks/products/pf/main-wrap-class >}}
10+
{{< blocks/products/pf/main-container >}}
11+
{{< blocks/products/pf/tutorial-page-section >}}
12+
13+
# Custom Image Markers in PowerPoint Line Charts with Aspose.Slides
14+
15+
Aspose.Slides for .NET provides comprehensive capabilities for creating feature-rich PowerPoint presentations programmatically. This example demonstrates how to create a line chart with custom image markers, allowing you to enhance data visualization with branded or meaningful images instead of standard markers. The library offers full control over chart elements, enabling developers to create professional presentations with minimal effort.
16+
17+
---
18+
{{< tutorial-widget sourcePath="slides/net/charts/chart-marker-options-on-data-point" >}}
19+
20+
{{< /blocks/products/pf/tutorial-page-section >}}
21+
{{< blocks/products/pf/tutorial-page-section >}}
22+
23+
## Installation Instructions
24+
25+
### Prerequisites
26+
- Visual Studio 2010 or higher
27+
- .NET Framework 4.0 or higher or .NET Standard 2.0
28+
- .NET Core 2.0 or higher
29+
30+
### Install via NuGet Package Manager
31+
1. Open your project in Visual Studio
32+
2. Navigate to Tools → NuGet Package Manager → Manage NuGet Packages for Solution
33+
3. Search for "Aspose.Slides"
34+
4. Click Install to add the package to your project
35+
36+
### Install via Package Manager Console
37+
```csharp
38+
PM> Install-Package Aspose.Slides.NET
39+
```
40+
41+
## Additional Resources
42+
- [Aspose.Slides for .NET Documentation](https://docs.aspose.com/slides/net/)
43+
- [Aspose.Slides for .NET API Reference](https://reference.aspose.com/slides/net/)
44+
45+
{{< /blocks/products/pf/tutorial-page-section >}}
46+
{{< /blocks/products/pf/main-container >}}
47+
{{< /blocks/products/pf/main-wrap-class >}}
48+
49+
{{< blocks/products/products-backtop-button >}}
Lines changed: 75 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,75 @@
1+
//ExStart
2+
//ExSummary: This code demonstrates how to create a line chart with custom image markers in a PowerPoint presentation using Aspose.Slides.
3+
//ExStepSummary:0: Defines the document directory path and loads an existing PowerPoint presentation.
4+
//ExStepSummary:1: Creates a default line chart with markers on the first slide with specified dimensions (400x400).
5+
//ExStepSummary:2: Gets a reference to the chart data workbook and clears any demo series data.
6+
//ExStepSummary:3: Adds a new series named "Series 1" to the chart.
7+
//ExStepSummary:4: Loads two image files and adds them to the presentation's image collection.
8+
//ExStepSummary:5: Adds the first data point to the line series with value 4.5 and sets its marker to use the first custom image.
9+
//ExStepSummary:6: Adds the second data point with value 2.5 and sets its marker to use the second custom image.
10+
//ExStepSummary:7: Adds the third data point with value 3.5 and sets its marker to use the first custom image again.
11+
//ExStepSummary:8: Adds the fourth data point with value 4.5 and sets its marker to use the second custom image again.
12+
//ExStepSummary:9: Sets the size of all markers in the series to 15 points.
13+
//ExStepSummary:10: Saves the modified presentation as "AsposeScatterChart.pptx" in the specified directory.
14+
//ExStepImage:5:images/1.png
15+
//ExStepImage:6:images/2.png
16+
//ExStepImage:7:images/3.png
17+
//ExStepImage:8:images/4.png
18+
//ExStepImage:9:images/5.png
19+
//ExStep:0-
20+
string dataDir = "Your Document Directory";
21+
Presentation pres = new Presentation(dataDir + "Test.pptx");
22+
ISlide slide = pres.Slides[0];
23+
24+
//ExStep:1-
25+
// Creating the default chart with specified dimensions
26+
IChart chart = slide.Shapes.AddChart(ChartType.LineWithMarkers, 0, 0, 400, 400);
27+
28+
//ExStep:2-
29+
// Getting the chart data workbook and clearing demo series
30+
int defaultWorksheetIndex = 0;
31+
IChartDataWorkbook fact = chart.ChartData.ChartDataWorkbook;
32+
chart.ChartData.Series.Clear();
33+
34+
//ExStep:3-
35+
// Adding new series to the chart
36+
chart.ChartData.Series.Add(fact.GetCell(defaultWorksheetIndex, 1, 1, "Series 1"), chart.Type);
37+
38+
//ExStep:4-
39+
// Loading and setting images for custom markers
40+
IImage img = Images.FromFile(dataDir + "aspose-logo.jpg");
41+
IPPImage imgx1 = pres.Images.AddImage(img);
42+
43+
IImage img2 = Images.FromFile(dataDir + "Tulips.jpg");
44+
IPPImage imgx2 = pres.Images.AddImage(img2);
45+
46+
//ExStep:5-
47+
// Adding data points with custom picture markers
48+
IChartSeries series = chart.ChartData.Series[0];
49+
50+
IChartDataPoint point = series.DataPoints.AddDataPointForLineSeries(fact.GetCell(defaultWorksheetIndex, 1, 1, 4.5));
51+
point.Marker.Format.Fill.FillType = FillType.Picture;
52+
point.Marker.Format.Fill.PictureFillFormat.Picture.Image = imgx1;
53+
54+
//ExStep:6-
55+
point = series.DataPoints.AddDataPointForLineSeries(fact.GetCell(defaultWorksheetIndex, 2, 1, 2.5));
56+
point.Marker.Format.Fill.FillType = FillType.Picture;
57+
point.Marker.Format.Fill.PictureFillFormat.Picture.Image = imgx2;
58+
59+
//ExStep:7-
60+
point = series.DataPoints.AddDataPointForLineSeries(fact.GetCell(defaultWorksheetIndex, 3, 1, 3.5));
61+
point.Marker.Format.Fill.FillType = FillType.Picture;
62+
point.Marker.Format.Fill.PictureFillFormat.Picture.Image = imgx1;
63+
64+
//ExStep:8-
65+
point = series.DataPoints.AddDataPointForLineSeries(fact.GetCell(defaultWorksheetIndex, 4, 1, 4.5));
66+
point.Marker.Format.Fill.FillType = FillType.Picture;
67+
point.Marker.Format.Fill.PictureFillFormat.Picture.Image = imgx2;
68+
69+
//ExStep:9-
70+
// Changing the chart series marker size
71+
series.Marker.Size = 15;
72+
73+
//ExStep:10-
74+
pres.Save(dataDir + "AsposeScatterChart.pptx", SaveFormat.Pptx);
75+
//ExEnd
Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
---
2+
title: Add Trend Lines to PowerPoint Charts Using Aspose.Slides for .NET
3+
weight: 7700
4+
limit:
5+
description: Learn how to add exponential, linear, and polynomial trend lines to PowerPoint charts using Aspose.Slides for .NET with step-by-step C# code examples.
6+
keywords: [Aspose.Slides for .NET, add trend line in PowerPoint, PowerPoint chart trend lines, exponential trend line C#, linear trend line C#, C# add chart trend lines]
7+
url: /net/charts/chart-trend-lines/
8+
---
9+
{{< blocks/products/pf/main-wrap-class >}}
10+
{{< blocks/products/pf/main-container >}}
11+
{{< blocks/products/pf/tutorial-page-section >}}
12+
13+
# Add Trend Lines to PowerPoint Charts Using Aspose.Slides
14+
15+
Adding trend lines to PowerPoint charts can enhance data visualization and improve insights. With [Aspose.Slides for .NET](https://docs.aspose.com/slides/net/), you can effortlessly create PowerPoint presentations and add various trend lines such as exponential, linear, logarithmic, and polynomial directly in your C# applications. This example demonstrates a step-by-step guide to inserting trend lines in clustered column charts, ensuring your presentations are both professional and informative. For detailed API references, visit the [Aspose.Slides for .NET API Reference](https://reference.aspose.com/slides/net/).
16+
17+
---
18+
{{< tutorial-widget sourcePath="slides/net/charts/chart-trend-lines" >}}
19+
20+
{{< /blocks/products/pf/tutorial-page-section >}}
21+
{{< blocks/products/pf/tutorial-page-section >}}
22+
## Installation Instructions
23+
To get started with Aspose.Slides for .NET, follow these steps:
24+
25+
1. Download Aspose.Slides for .NET
26+
Download the latest version from the [Aspose.Slides for .NET Download Page](https://releases.aspose.com/slides/net/).
27+
28+
2. Install via NuGet
29+
Run the following command in the Package Manager Console:
30+
```shell
31+
Install-Package Aspose.Slides.NET
32+
```
33+
34+
3. Apply a License (Optional but Recommended)
35+
For full functionality without evaluation limitations, obtain a [temporary license](https://purchase.aspose.com/temporary-license/) or purchase a [full license](https://purchase.aspose.com/buy).
36+
37+
38+
{{< /blocks/products/pf/tutorial-page-section >}}
39+
{{< /blocks/products/pf/main-container >}}
40+
{{< /blocks/products/pf/main-wrap-class >}}
41+
42+
{{< blocks/products/products-backtop-button >}}

0 commit comments

Comments
 (0)