File tree Expand file tree Collapse file tree 2 files changed +4
-8
lines changed
Create and Edit Charts/Position Chart/.NET/Position Chart Expand file tree Collapse file tree 2 files changed +4
-8
lines changed Original file line number Diff line number Diff line change @@ -12,12 +12,10 @@ static void Main(string[] args)
1212 {
1313 IApplication application = excelEngine . Excel ;
1414 application . DefaultVersion = ExcelVersion . Xlsx ;
15-
16- // Create a new workbook
1715 IWorkbook workbook = application . Workbooks . Create ( 1 ) ;
1816 IWorksheet worksheet = workbook . Worksheets [ 0 ] ;
1917
20- // Fill sample data
18+ //Add data
2119 worksheet . Range [ "A1" ] . Text = "Category" ;
2220 worksheet . Range [ "B1" ] . Text = "Value" ;
2321 worksheet . Range [ "A2" ] . Text = "A" ;
@@ -27,7 +25,7 @@ static void Main(string[] args)
2725 worksheet . Range [ "B3" ] . Number = 20 ;
2826 worksheet . Range [ "B4" ] . Number = 30 ;
2927
30- // Add a chart
28+ //Add a chart
3129 IChartShape chart = worksheet . Charts . Add ( ) ;
3230 chart . DataRange = worksheet . Range [ "A1:B4" ] ;
3331 chart . ChartType = ExcelChartType . Column_Clustered ;
Original file line number Diff line number Diff line change @@ -21,12 +21,10 @@ using (ExcelEngine excelEngine = new ExcelEngine())
2121{
2222 IApplication application = excelEngine .Excel ;
2323 application .DefaultVersion = ExcelVersion .Xlsx ;
24-
25- // Create a new workbook
2624 IWorkbook workbook = application .Workbooks .Create (1 );
2725 IWorksheet worksheet = workbook .Worksheets [0 ];
2826
29- // Fill sample data
27+ // Add data
3028 worksheet .Range [" A1" ].Text = " Category" ;
3129 worksheet .Range [" B1" ].Text = " Value" ;
3230 worksheet .Range [" A2" ].Text = " A" ;
@@ -36,7 +34,7 @@ using (ExcelEngine excelEngine = new ExcelEngine())
3634 worksheet .Range [" B3" ].Number = 20 ;
3735 worksheet .Range [" B4" ].Number = 30 ;
3836
39- // Add a chart
37+ // Add a chart
4038 IChartShape chart = worksheet .Charts .Add ();
4139 chart .DataRange = worksheet .Range [" A1:B4" ];
4240 chart .ChartType = ExcelChartType .Column_Clustered ;
You can’t perform that action at this time.
0 commit comments