Skip to content

Commit 1c472c6

Browse files
Updated GitHub for Ft samples.
1 parent 2fa56cc commit 1c472c6

File tree

11 files changed

+147
-2
lines changed

11 files changed

+147
-2
lines changed
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
2+
Microsoft Visual Studio Solution File, Format Version 12.00
3+
# Visual Studio Version 17
4+
VisualStudioVersion = 17.11.35327.3
5+
MinimumVisualStudioVersion = 10.0.40219.1
6+
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Create-simple-pie-chart", "Create-simple-pie-chart\Create-simple-pie-chart.csproj", "{FC263D1D-3AA3-4B8E-B158-B02C0FF627CB}"
7+
EndProject
8+
Global
9+
GlobalSection(SolutionConfigurationPlatforms) = preSolution
10+
Debug|Any CPU = Debug|Any CPU
11+
Release|Any CPU = Release|Any CPU
12+
EndGlobalSection
13+
GlobalSection(ProjectConfigurationPlatforms) = postSolution
14+
{FC263D1D-3AA3-4B8E-B158-B02C0FF627CB}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
15+
{FC263D1D-3AA3-4B8E-B158-B02C0FF627CB}.Debug|Any CPU.Build.0 = Debug|Any CPU
16+
{FC263D1D-3AA3-4B8E-B158-B02C0FF627CB}.Release|Any CPU.ActiveCfg = Release|Any CPU
17+
{FC263D1D-3AA3-4B8E-B158-B02C0FF627CB}.Release|Any CPU.Build.0 = Release|Any CPU
18+
EndGlobalSection
19+
GlobalSection(SolutionProperties) = preSolution
20+
HideSolutionNode = FALSE
21+
EndGlobalSection
22+
GlobalSection(ExtensibilityGlobals) = postSolution
23+
SolutionGuid = {C73989D0-3A0F-40E1-9FAA-E04EB4173B7A}
24+
EndGlobalSection
25+
EndGlobal
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
<Project Sdk="Microsoft.NET.Sdk">
2+
3+
<PropertyGroup>
4+
<OutputType>Exe</OutputType>
5+
<TargetFramework>net8.0</TargetFramework>
6+
<RootNamespace>Create_simple_pie_chart</RootNamespace>
7+
<ImplicitUsings>enable</ImplicitUsings>
8+
<Nullable>enable</Nullable>
9+
</PropertyGroup>
10+
11+
<ItemGroup>
12+
<PackageReference Include="Syncfusion.Presentation.NET" Version="*" />
13+
</ItemGroup>
14+
<ItemGroup>
15+
<None Update="Output\Result.pptx">
16+
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
17+
</None>
18+
</ItemGroup>
19+
</Project>
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
using Syncfusion.OfficeChart;
2+
using Syncfusion.Presentation;
3+
4+
//Create an instance of presentation.
5+
using IPresentation presentation = Presentation.Create();
6+
//Add a blank slide to the presentation.
7+
ISlide slide = presentation.Slides.Add(SlideLayoutType.Blank);
8+
//Add a chart to the slide with position and size.
9+
IPresentationChart chart = slide.Charts.AddChart(100, 10, 700, 500);
10+
//Select the chart type.
11+
chart.ChartType = OfficeChartType.Pie;
12+
//Assign data range.
13+
chart.DataRange = chart.ChartData[1, 1, 6, 2];
14+
chart.IsSeriesInRows = false;
15+
//Set the values for the chart data.
16+
chart.ChartData.SetValue(1, 1, "Food");
17+
chart.ChartData.SetValue(2, 1, "Fruits");
18+
chart.ChartData.SetValue(3, 1, "Vegetables");
19+
chart.ChartData.SetValue(4, 1, "Dairy");
20+
chart.ChartData.SetValue(5, 1, "Protein");
21+
chart.ChartData.SetValue(6, 1, "Grains");
22+
chart.ChartData.SetValue(1, 2, "Percentage");
23+
chart.ChartData.SetValue(2, 2, 36);
24+
chart.ChartData.SetValue(3, 2, 14);
25+
chart.ChartData.SetValue(4, 2, 13);
26+
chart.ChartData.SetValue(5, 2, 28);
27+
chart.ChartData.SetValue(6, 2, 9);
28+
//Set data labels.
29+
chart.Series[0].DataPoints.DefaultDataPoint.DataLabels.IsValue = true;
30+
//Save the presentation.
31+
using FileStream outputStream = new FileStream(Path.GetFullPath(@"Output/Result.pptx"), FileMode.Create, FileAccess.ReadWrite);
32+
presentation.Save(outputStream);
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
2+
Microsoft Visual Studio Solution File, Format Version 12.00
3+
# Visual Studio Version 17
4+
VisualStudioVersion = 17.11.35327.3
5+
MinimumVisualStudioVersion = 10.0.40219.1
6+
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Simple-text-and-paragraph-formatting", "Simple-text-and-paragraph-formatting\Simple-text-and-paragraph-formatting.csproj", "{AAA91223-CD0E-4333-BC4C-F98D29CC228A}"
7+
EndProject
8+
Global
9+
GlobalSection(SolutionConfigurationPlatforms) = preSolution
10+
Debug|Any CPU = Debug|Any CPU
11+
Release|Any CPU = Release|Any CPU
12+
EndGlobalSection
13+
GlobalSection(ProjectConfigurationPlatforms) = postSolution
14+
{AAA91223-CD0E-4333-BC4C-F98D29CC228A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
15+
{AAA91223-CD0E-4333-BC4C-F98D29CC228A}.Debug|Any CPU.Build.0 = Debug|Any CPU
16+
{AAA91223-CD0E-4333-BC4C-F98D29CC228A}.Release|Any CPU.ActiveCfg = Release|Any CPU
17+
{AAA91223-CD0E-4333-BC4C-F98D29CC228A}.Release|Any CPU.Build.0 = Release|Any CPU
18+
EndGlobalSection
19+
GlobalSection(SolutionProperties) = preSolution
20+
HideSolutionNode = FALSE
21+
EndGlobalSection
22+
GlobalSection(ExtensibilityGlobals) = postSolution
23+
SolutionGuid = {879355F6-5C8B-4DE1-9A87-B35CF94F090B}
24+
EndGlobalSection
25+
EndGlobal
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
using Syncfusion.Presentation;
2+
3+
//Load PowerPoint Presentation.
4+
using FileStream inputStream = new(Path.GetFullPath(@"Data/Template.pptx"), FileMode.Open, FileAccess.Read, FileShare.ReadWrite);
5+
//Open an existing PowerPoint presentation.
6+
using IPresentation pptxDoc = Presentation.Open(inputStream);
7+
//Retrieve the first slide from Presentation
8+
ISlide slide = pptxDoc.Slides[0];
9+
//Retrieve the first shape.
10+
IShape shape = slide.Shapes[0] as IShape;
11+
//Retrieve the first paragraph of the shape.
12+
IParagraph paragraph = shape.TextBody.Paragraphs[0];
13+
//Set center alignment for the paragraph.
14+
paragraph.HorizontalAlignment = HorizontalAlignmentType.Center;
15+
//Retrieve the first TextPart of the shape.
16+
ITextPart textPart = paragraph.TextParts[0];
17+
//Set bold for the text.
18+
textPart.Font.Bold = true;
19+
//Save the PowerPoint Presentation.
20+
using FileStream outputStream = new(Path.GetFullPath(@"Output/Result.pptx"), FileMode.Create, FileAccess.ReadWrite);
21+
pptxDoc.Save(outputStream);
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
<Project Sdk="Microsoft.NET.Sdk">
2+
3+
<PropertyGroup>
4+
<OutputType>Exe</OutputType>
5+
<TargetFramework>net8.0</TargetFramework>
6+
<RootNamespace>Simple_text_and_paragraph_formatting</RootNamespace>
7+
<ImplicitUsings>enable</ImplicitUsings>
8+
<Nullable>enable</Nullable>
9+
</PropertyGroup>
10+
11+
<ItemGroup>
12+
<PackageReference Include="Syncfusion.Presentation.NET" Version="*" />
13+
</ItemGroup>
14+
15+
<ItemGroup>
16+
<None Update="Data\Template.pptx">
17+
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
18+
</None>
19+
<None Update="Output\Result.pptx">
20+
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
21+
</None>
22+
</ItemGroup>
23+
</Project>

PowerPoint-Presentation/Merge-two-presentations/.NET/Merge-two-presentations/Merge-two-presentations.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
<None Update="Data\DestinationPresentation.pptx">
2020
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
2121
</None>
22-
<None Update="Output\.gitkeep">
22+
<None Update="Output\Result.pptx">
2323
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
2424
</None>
2525
</ItemGroup>

Slides/Merge-PowerPoint-slide/.NET/Merge-PowerPoint-slide/Merge-PowerPoint-slide.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
<None Update="Data\DestinationPresentation.pptx">
1919
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
2020
</None>
21-
<None Update="Output\Result.pptx">
21+
<None Update="Output\.gitkeep">
2222
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
2323
</None>
2424
</ItemGroup>

0 commit comments

Comments
 (0)