Skip to content

Commit ae0bad0

Browse files
Merge pull request #1523 from Syncfusion-Content/hotfix/hotfix-v23.1.36
DOCINFRA-2341_merged_using_automation
2 parents f56dbaf + dbc1059 commit ae0bad0

10 files changed

+945
-0
lines changed

File-Formats-toc.html

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -674,6 +674,7 @@
674674
<li><a href="/file-formats/pdf/Working-with-OCR/Azure-Vision">Azure Vision</a></li>
675675
<li><a href="/file-formats/pdf/Working-with-OCR/AWS-Textract">AWS Textract</a></li>
676676
<li><a href="/file-formats/pdf/Working-with-OCR/Linux">Linux</a></li>
677+
<li><a href="/file-formats/pdf/Working-with-OCR/mac">Mac</a></li>
677678
</ul>
678679
</li>
679680
<li><a href="/file-formats/pdf/Working-with-OCR/Features">Features</a></li>
@@ -1066,6 +1067,7 @@
10661067
<li><a href="/file-formats/xlsio/create-read-edit-excel-files-in-maui-c-sharp">.NET MAUI</a></li>
10671068
<li><a href="/file-formats/xlsio/create-read-edit-excel-files-in-linux-c-sharp">Linux</a></li>
10681069
<li><a href="/file-formats/xlsio/create-read-edit-excel-files-in-mac-c-sharp">Mac</a></li>
1070+
<li><a href="/file-formats/xlsio/create-excel-files-in-console-apps-c-sharp">Console</a></li>
10691071
<li>
10701072
<a href="/file-formats/xlsio/create-excel-document-in-azure">Azure</a>
10711073
<ul>
@@ -1231,6 +1233,7 @@
12311233
<li><a href="/file-formats/xlsio/faqs/why-cone-chart-shows-itself-as-colum-or-bar-chart">Why cone chart shows itself as column or bar chart</a></li>
12321234
<li><a href="/file-formats/xlsio/faqs/how-to-vary-colors-by-point-for-line-and-column-chart">How to vary colors by point for line and column chart</a></li>
12331235
<li><a href="/file-formats/xlsio/faqs/how-to-upload-a-file-to-azure-blob-and-download-as-stream">How to upload a file to Azure blob and download as stream</a></li>
1236+
<li><a href="/file-formats/xlsio/faqs/how-to-set-rounded-corner-for-chart-in-excel-document">How to set rounded corner for chart in Excel document</a></li>
12341237
</ul>
12351238
</li>
12361239
</ul>
247 KB
Loading
84.3 KB
Loading
716 KB
Loading
75.5 KB
Loading
209 KB
Loading
96.6 KB
Loading
605 KB
Loading

File-Formats/XlsIO/create-excel-files-in-console-apps-c-sharp.md

Lines changed: 818 additions & 0 deletions
Large diffs are not rendered by default.
Lines changed: 124 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,124 @@
1+
---
2+
title: How to set rounded corner for chart in Excel document | Syncfusion
3+
description: Code example to set rounded corner for chart in Excel document using Syncfusion .NET Excel library (XlsIO).
4+
platform: file-formats
5+
control: XlsIO
6+
documentation: UG
7+
---
8+
9+
# How to set rounded corner for chart in Excel document?
10+
11+
The following code snippet shows how to set rounded corner for chart in Excel document.
12+
13+
{% tabs %}
14+
{% highlight c# tabtitle="C# [Cross-platform]" %}
15+
using (ExcelEngine excelEngine = new ExcelEngine())
16+
{
17+
IApplication application = excelEngine.Excel;
18+
application.DefaultVersion = ExcelVersion.Xlsx;
19+
IWorkbook workbook = application.Workbooks.Create(1);
20+
IWorksheet sheet = workbook.Worksheets[0];
21+
22+
object[] xValues = new object[] { "Total Income", "Expenses", "Profit" };
23+
object[] yValues = new object[] { 2000, 1000, 1500 };
24+
25+
//Adding series and values
26+
IChartShape chart = sheet.Charts.Add();
27+
IChartSerie serie = chart.Series.Add(ExcelChartType.Column_Clustered);
28+
29+
//set the rounded border for the chart
30+
chart.ChartArea.IsBorderCornersRound = true;
31+
32+
//sets the top row of the chart
33+
chart.TopRow = 5;
34+
chart.BottomRow = 20;
35+
chart.LeftColumn = 5;
36+
chart.RightColumn = 13;
37+
38+
//Enters the X and Y values directly
39+
serie.EnteredDirectlyValues = yValues;
40+
serie.EnteredDirectlyCategoryLabels = xValues;
41+
42+
//Saving the workbook as stream
43+
FileStream stream = new FileStream("Chart.xlsx", FileMode.Create, FileAccess.ReadWrite);
44+
workbook.SaveAs(stream);
45+
stream.Dispose();
46+
}
47+
{% endhighlight %}
48+
49+
{% highlight c# tabtitle="C# [Windows-specific]" %}
50+
using (ExcelEngine excelEngine = new ExcelEngine())
51+
{
52+
IApplication application = excelEngine.Excel;
53+
application.DefaultVersion = ExcelVersion.Xlsx;
54+
IWorkbook workbook = application.Workbooks.Create(1);
55+
IWorksheet sheet = workbook.Worksheets[0];
56+
57+
object[] xValues = new object[] { "Total Income", "Expenses", "Profit" };
58+
object[] yValues = new object[] { 2000, 1000, 1500 };
59+
60+
//Adding series and values
61+
IChartShape chart = sheet.Charts.Add();
62+
IChartSerie serie = chart.Series.Add(ExcelChartType.Column_Clustered);
63+
64+
//set the rounded border for the chart
65+
chart.ChartArea.IsBorderCornersRound = true;
66+
67+
//sets the top row of the chart
68+
chart.TopRow = 5;
69+
chart.BottomRow = 20;
70+
chart.LeftColumn = 5;
71+
chart.RightColumn = 13;
72+
73+
//Enters the X and Y values directly
74+
serie.EnteredDirectlyValues = yValues;
75+
serie.EnteredDirectlyCategoryLabels = xValues;
76+
77+
//Saving the workbook
78+
workbook.SaveAs("Chart.xlsx");
79+
stream.Dispose();
80+
}
81+
{% endhighlight %}
82+
83+
{% highlight vb.net tabtitle="VB.NET [Windows-specific]" %}
84+
Using excelEngine As ExcelEngine = New ExcelEngine()
85+
Dim Application As IApplication = excelEngine.Excel
86+
Application.DefaultVersion = ExcelVersion.Xlsx
87+
Dim workbook As IWorkbook = Application.Workbooks.Create(1)
88+
Dim sheet As IWorksheet = workbook.Worksheets(0)
89+
90+
Dim xValues As Object() = New Object() {"Total Income", "Expenses", "Profit"}
91+
Dim yValues As Object() = New Object() {2000, 1000, 1000}
92+
93+
'Adding series And values
94+
Dim chart As IChartShape = sheet.Charts.Add()
95+
Dim serie As IChartSerie = chart.Series.Add(ExcelChartType.Column_Clustered)
96+
97+
'set the rounded border for the chart
98+
chart.ChartArea.IsBorderCornersRound = True
99+
100+
'sets the top row of the chart
101+
chart.TopRow = 5
102+
chart.BottomRow = 20
103+
chart.LeftColumn = 5
104+
chart.RightColumn = 13
105+
106+
'Enters the X And Y values directly
107+
serie.EnteredDirectlyValues = yValues
108+
serie.EnteredDirectlyCategoryLabels = xValues
109+
110+
'Saving the workbook as stream
111+
Dim Stream As FileStream = New FileStream("Chart.xlsx", FileMode.Create, FileAccess.ReadWrite)
112+
workbook.SaveAs(Stream)
113+
Stream.Dispose()
114+
End Using
115+
{% endhighlight %}
116+
{% endtabs %}
117+
118+
## See Also
119+
120+
* [How to change the border style for chart series](https://help.syncfusion.com/file-formats/xlsio/working-with-charts#border-style-for-chart-series)
121+
* [How to explode a Pie Chart](https://help.syncfusion.com/file-formats/xlsio/working-with-charts#explode-a-pie-chart)
122+
* [How to add picture to the chart and assign hyperlink](https://help.syncfusion.com/file-formats/xlsio/working-with-charts#add-picture-to-chart-and-assign-hyperlink)
123+
* [How to customizing chart and chart elements](https://help.syncfusion.com/file-formats/xlsio/working-with-charts#customizing-chart-and-chart-elements)
124+
* [How to add data label to the chart](https://help.syncfusion.com/file-formats/xlsio/working-with-charts#add-datatable-to-chart)

0 commit comments

Comments
 (0)