From 1bfa9270068d6658e11081fc784d7b8be198e9f4 Mon Sep 17 00:00:00 2001 From: KurmithaSF4004 Date: Fri, 25 Oct 2024 18:14:10 +0530 Subject: [PATCH] Create and Edit Charts --- .../Create Chart and Customize.sln | 22 +++ .../Create Chart and Customize.csproj | 23 +++ .../Data/InputTemplate.xlsx | Bin 0 -> 8453 bytes .../Output/.gitkeep | 0 .../Create Chart and Customize/Program.cs | 167 ++++++++++++++++++ 5 files changed, 212 insertions(+) create mode 100644 Create and Edit Charts/Create Chart and Customize/.NET/Create Chart and Customize/Create Chart and Customize.sln create mode 100644 Create and Edit Charts/Create Chart and Customize/.NET/Create Chart and Customize/Create Chart and Customize/Create Chart and Customize.csproj create mode 100644 Create and Edit Charts/Create Chart and Customize/.NET/Create Chart and Customize/Create Chart and Customize/Data/InputTemplate.xlsx create mode 100644 Create and Edit Charts/Create Chart and Customize/.NET/Create Chart and Customize/Create Chart and Customize/Output/.gitkeep create mode 100644 Create and Edit Charts/Create Chart and Customize/.NET/Create Chart and Customize/Create Chart and Customize/Program.cs diff --git a/Create and Edit Charts/Create Chart and Customize/.NET/Create Chart and Customize/Create Chart and Customize.sln b/Create and Edit Charts/Create Chart and Customize/.NET/Create Chart and Customize/Create Chart and Customize.sln new file mode 100644 index 00000000..662b6ba0 --- /dev/null +++ b/Create and Edit Charts/Create Chart and Customize/.NET/Create Chart and Customize/Create Chart and Customize.sln @@ -0,0 +1,22 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio Version 17 +VisualStudioVersion = 17.12.35417.141 d17.12 +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Create Chart and Customize", "Create Chart and Customize\Create Chart and Customize.csproj", "{DCBE2799-4105-45DD-AA01-9B3B6230E436}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Release|Any CPU = Release|Any CPU + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {DCBE2799-4105-45DD-AA01-9B3B6230E436}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {DCBE2799-4105-45DD-AA01-9B3B6230E436}.Debug|Any CPU.Build.0 = Debug|Any CPU + {DCBE2799-4105-45DD-AA01-9B3B6230E436}.Release|Any CPU.ActiveCfg = Release|Any CPU + {DCBE2799-4105-45DD-AA01-9B3B6230E436}.Release|Any CPU.Build.0 = Release|Any CPU + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection +EndGlobal diff --git a/Create and Edit Charts/Create Chart and Customize/.NET/Create Chart and Customize/Create Chart and Customize/Create Chart and Customize.csproj b/Create and Edit Charts/Create Chart and Customize/.NET/Create Chart and Customize/Create Chart and Customize/Create Chart and Customize.csproj new file mode 100644 index 00000000..88c5e99b --- /dev/null +++ b/Create and Edit Charts/Create Chart and Customize/.NET/Create Chart and Customize/Create Chart and Customize/Create Chart and Customize.csproj @@ -0,0 +1,23 @@ + + + + Exe + net8.0 + Create_Chart_and_Customize + enable + enable + + + + + + + + + Always + + + Always + + + diff --git a/Create and Edit Charts/Create Chart and Customize/.NET/Create Chart and Customize/Create Chart and Customize/Data/InputTemplate.xlsx b/Create and Edit Charts/Create Chart and Customize/.NET/Create Chart and Customize/Create Chart and Customize/Data/InputTemplate.xlsx new file mode 100644 index 0000000000000000000000000000000000000000..d2aae6db55317280cd4d80f008811ff0ff58526b GIT binary patch literal 8453 zcmeHM1y@yR+diapcXyYBG$JJ>97<9;4tXf)M(I2tDM*8KcY{*W-AG7xmwd;0XWns~ z`F_DW&t7XkYp=Dhd+mKc*WEw`ICwk&A^-^h08j&r57I#TFaSUdJOF?TK!Vkk1lu{A z**P1iyW5*Nz2b1QwV}#_hh@qDz(U{ucl{4*pg4X&sf!Cs`cn2za-Cg%p;8=)Z$F?1 zhebuKy*uu6p^0v~rR76<=q;8+CcYJa1EqmK4r1|F&SV`2k?Nb^)cl0#jWDzDV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Chart and Customize/Create Chart and Customize/Output/.gitkeep b/Create and Edit Charts/Create Chart and Customize/.NET/Create Chart and Customize/Create Chart and Customize/Output/.gitkeep new file mode 100644 index 00000000..e69de29b diff --git a/Create and Edit Charts/Create Chart and Customize/.NET/Create Chart and Customize/Create Chart and Customize/Program.cs b/Create and Edit Charts/Create Chart and Customize/.NET/Create Chart and Customize/Create Chart and Customize/Program.cs new file mode 100644 index 00000000..4c39bbc9 --- /dev/null +++ b/Create and Edit Charts/Create Chart and Customize/.NET/Create Chart and Customize/Create Chart and Customize/Program.cs @@ -0,0 +1,167 @@ +using Syncfusion.XlsIO; +using Syncfusion.Drawing; + +namespace Create_Chart_and_Customize +{ + class Program + { + public static void Main(string[] args) + { + using (ExcelEngine excelEngine = new ExcelEngine()) + { + IApplication application = excelEngine.Excel; + application.DefaultVersion = ExcelVersion.Xlsx; + + //Load an existing Excel file + FileStream inputStream = new FileStream(Path.GetFullPath(@"Data/InputTemplate.xlsx"), FileMode.Open, FileAccess.Read); + IWorkbook workbook = application.Workbooks.Open(inputStream); + IWorksheet worksheet = workbook.Worksheets[0]; + + //Create a Chart + IChartShape chart = worksheet.Charts.Add(); + + //Set the Chart Type + chart.ChartType = ExcelChartType.Column_Clustered; + + //Set data range in the worksheet + chart.DataRange = worksheet.Range["A1:C6"]; + + //Specify that the series are in columns + chart.IsSeriesInRows = false; + + //Positioning the chart in the worksheet + chart.TopRow = 8; + chart.LeftColumn = 1; + chart.BottomRow = 23; + chart.RightColumn = 8; + + //Set the chart title + chart.ChartTitle = "Purchase Details"; + + //Format chart title color and font + chart.ChartTitleArea.Color = ExcelKnownColors.Black; + + chart.ChartTitleArea.FontName = "Calibri"; + chart.ChartTitleArea.Bold = true; + chart.ChartTitleArea.Underline = ExcelUnderline.Single; + chart.ChartTitleArea.Size = 15; + + //Format Chart Area + IChartFrameFormat chartArea = chart.ChartArea; + + //Format chart area border and color + chartArea.Border.LinePattern = ExcelChartLinePattern.Solid; + chartArea.Border.LineColor = Color.Pink; + chartArea.Border.LineWeight = ExcelChartLineWeight.Hairline; + + chartArea.Fill.FillType = ExcelFillType.Gradient; + chartArea.Fill.GradientColorType = ExcelGradientColor.TwoColor; + chartArea.Fill.BackColor = Color.FromArgb(205, 217, 234); + chartArea.Fill.ForeColor = Color.White; + + //Format Plot Area + IChartFrameFormat chartPlotArea = chart.PlotArea; + + //Format plot area border and color + chartPlotArea.Border.LinePattern = ExcelChartLinePattern.Solid; + chartPlotArea.Border.LineColor = Color.Pink; + chartPlotArea.Border.LineWeight = ExcelChartLineWeight.Hairline; + + chartPlotArea.Fill.FillType = ExcelFillType.Gradient; + chartPlotArea.Fill.GradientColorType = ExcelGradientColor.TwoColor; + chartPlotArea.Fill.BackColor = Color.FromArgb(205, 217, 234); + chartPlotArea.Fill.ForeColor = Color.White; + + //Format Series + IChartSerie serie1 = chart.Series[0]; + IChartSerie serie2 = chart.Series[1]; + + //Format series border and color + serie1.SerieFormat.LineProperties.LineColor = Color.Pink; + serie1.SerieFormat.LineProperties.LinePattern = ExcelChartLinePattern.Dot; + serie1.SerieFormat.LineProperties.LineWeight = ExcelChartLineWeight.Narrow; + + serie2.SerieFormat.LineProperties.LineColor = Color.Pink; + serie2.SerieFormat.LineProperties.LinePattern = ExcelChartLinePattern.Dot; + serie2.SerieFormat.LineProperties.LineWeight = ExcelChartLineWeight.Narrow; + + serie1.SerieFormat.Fill.FillType = ExcelFillType.Gradient; + serie1.SerieFormat.Fill.GradientColorType = ExcelGradientColor.TwoColor; + serie1.SerieFormat.Fill.BackColor = Color.FromArgb(205, 217, 234); + serie1.SerieFormat.Fill.ForeColor = Color.Pink; + + serie2.SerieFormat.Fill.FillType = ExcelFillType.Gradient; + serie2.SerieFormat.Fill.GradientColorType = ExcelGradientColor.TwoColor; + serie2.SerieFormat.Fill.BackColor = Color.FromArgb(205, 217, 234); + serie2.SerieFormat.Fill.ForeColor = Color.Pink; + + //Set Datalabel + serie1.DataPoints.DefaultDataPoint.DataLabels.IsValue = true; + serie2.DataPoints.DefaultDataPoint.DataLabels.IsValue = true; + serie1.DataPoints.DefaultDataPoint.DataLabels.Position = ExcelDataLabelPosition.Outside; + serie2.DataPoints.DefaultDataPoint.DataLabels.Position = ExcelDataLabelPosition.Outside; + + //Format data labels color and font + serie1.DataPoints.DefaultDataPoint.DataLabels.Color = ExcelKnownColors.Black; + serie2.DataPoints.DefaultDataPoint.DataLabels.Color = ExcelKnownColors.Black; + + serie1.DataPoints.DefaultDataPoint.DataLabels.Size = 10; + serie1.DataPoints.DefaultDataPoint.DataLabels.FontName = "calibri"; + serie1.DataPoints.DefaultDataPoint.DataLabels.Bold = true; + + serie2.DataPoints.DefaultDataPoint.DataLabels.Size = 10; + serie2.DataPoints.DefaultDataPoint.DataLabels.FontName = "calibri"; + serie2.DataPoints.DefaultDataPoint.DataLabels.Bold = true; + + //Set Legend + chart.HasLegend = true; + chart.Legend.Position = ExcelLegendPosition.Bottom; + + //Format legend border, color, and font + chart.Legend.FrameFormat.Border.AutoFormat = false; + chart.Legend.FrameFormat.Border.IsAutoLineColor = false; + chart.Legend.FrameFormat.Border.LineColor = Color.Black; + chart.Legend.FrameFormat.Border.LinePattern = ExcelChartLinePattern.LightGray; + chart.Legend.FrameFormat.Border.LineWeight = ExcelChartLineWeight.Narrow; + + chart.Legend.TextArea.Color = ExcelKnownColors.Black; + + chart.Legend.TextArea.Bold = true; + chart.Legend.TextArea.FontName = "Calibri"; + chart.Legend.TextArea.Size = 8; + chart.Legend.TextArea.Strikethrough = false; + + //Set axis title + chart.PrimaryCategoryAxis.Title = "Items"; + chart.PrimaryValueAxis.Title = "Amount in($) and counts"; + + //Format chart axis border and font + chart.PrimaryCategoryAxis.Border.LinePattern = ExcelChartLinePattern.CircleDot; + chart.PrimaryCategoryAxis.Border.LineColor = Color.Pink; + chart.PrimaryCategoryAxis.Border.LineWeight = ExcelChartLineWeight.Hairline; + + chart.PrimaryValueAxis.Border.LinePattern = ExcelChartLinePattern.CircleDot; + chart.PrimaryValueAxis.Border.LineColor = Color.Pink; + chart.PrimaryValueAxis.Border.LineWeight = ExcelChartLineWeight.Hairline; + + chart.PrimaryCategoryAxis.Font.Color = ExcelKnownColors.Black; + chart.PrimaryCategoryAxis.Font.FontName = "Calibri"; + chart.PrimaryCategoryAxis.Font.Bold = true; + chart.PrimaryCategoryAxis.Font.Size = 8; + + chart.PrimaryValueAxis.Font.Color = ExcelKnownColors.Black; + chart.PrimaryValueAxis.Font.FontName = "Calibri"; + chart.PrimaryValueAxis.Font.Bold = true; + chart.PrimaryValueAxis.Font.Size = 8; + + //Saving the workbook + FileStream outputStream = new FileStream(Path.GetFullPath("Output/Chart.xlsx"), FileMode.Create, FileAccess.Write); + workbook.SaveAs(outputStream); + + //Dispose stream + inputStream.Dispose(); + outputStream.Dispose(); + } + } + } +}