Skip to content

Commit bf09118

Browse files
Merge pull request #100 from SureshGanesanSF4645/master
Update GitHub for FT samples
2 parents 6209edf + d16ca46 commit bf09118

File tree

35 files changed

+227
-70
lines changed

35 files changed

+227
-70
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\.gitkeep">
16+
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
17+
</None>
18+
</ItemGroup>
19+
</Project>
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+

Binary file not shown.
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);
Loading
Loading
Loading

0 commit comments

Comments
 (0)