Interface IChartBorder
Represents chart border. Provides Border options for Chart Area and Plot Area.
Namespace: Syncfusion.XlsIO
Assembly: Syncfusion.XlsIO.NET.dll
Syntax
public interface IChartBorder
Properties
AutoFormat
Gets or sets a boolean value indicating if the border has default or custom format.
Declaration
bool AutoFormat { get; set; }
Property Value
Type |
---|
System.Boolean |
Remarks
To know more about charts refer this link.
Examples
The following code illustrates the use of AutoFormat property.
using (ExcelEngine excelEngine = new ExcelEngine())
{
//Create a worksheet.
IApplication application = excelEngine.Excel;
application.DefaultVersion = ExcelVersion.Excel2013;
IWorkbook workbook = application.Workbooks.Create(1);
IWorksheet sheet = workbook.Worksheets[0];
sheet.Range["A1"].Text = "Student ID";
sheet.Range["B1"].Text = "Student Name";
sheet.Range["C1"].Text = "Mark(Out of 100)";
sheet.Range["A1:C1"].AutofitColumns();
sheet.Range["A2"].Number = 1;
sheet.Range["A3"].Number = 2;
sheet.Range["A4"].Number = 3;
sheet.Range["A5"].Number = 4;
sheet.Range["A6"].Number = 5;
sheet.Range["B2"].Text = "Andrew";
sheet.Range["B3"].Text = "Marson";
sheet.Range["B4"].Text = "Jack";
sheet.Range["B5"].Text = "Sam";
sheet.Range["B6"].Text = "Breto";
sheet.Range["C2"].Number = 77;
sheet.Range["C3"].Number = 45;
sheet.Range["C4"].Number = 92;
sheet.Range["C5"].Number = 39;
sheet.Range["C6"].Number = 55;
//Create a Chart
IChartShape chart = sheet.Charts.Add();
chart.LeftColumn = 5;
chart.RightColumn = 11;
chart.Name = "Student Sample Chart";
chart.ChartType = ExcelChartType.Cone_Clustered_3D;
chart.DataRange = sheet.Range["B2:C6"];
//True to enable the autoFormat for border
chart.ChartArea.Border.AutoFormat = true;
workbook.SaveAs("Charts.xlsx");
workbook.Close();
}
ColorIndex
Gets or sets the index of the border color in ExcelKnownColors.
Declaration
ExcelKnownColors ColorIndex { get; set; }
Property Value
Type |
---|
ExcelKnownColors |
Remarks
To know more about charts refer this link.
Examples
The following code illustrates the use of ColorIndex property.
using (ExcelEngine excelEngine = new ExcelEngine())
{
//Create a worksheet.
IApplication application = excelEngine.Excel;
application.DefaultVersion = ExcelVersion.Excel2013;
IWorkbook workbook = application.Workbooks.Create(1);
IWorksheet sheet = workbook.Worksheets[0];
sheet.Range["A1"].Text = "Student ID";
sheet.Range["B1"].Text = "Student Name";
sheet.Range["C1"].Text = "Mark(Out of 100)";
sheet.Range["A1:C1"].AutofitColumns();
sheet.Range["A2"].Number = 1;
sheet.Range["A3"].Number = 2;
sheet.Range["A4"].Number = 3;
sheet.Range["A5"].Number = 4;
sheet.Range["A6"].Number = 5;
sheet.Range["B2"].Text = "Andrew";
sheet.Range["B3"].Text = "Marson";
sheet.Range["B4"].Text = "Jack";
sheet.Range["B5"].Text = "Sam";
sheet.Range["B6"].Text = "Breto";
sheet.Range["C2"].Number = 77;
sheet.Range["C3"].Number = 45;
sheet.Range["C4"].Number = 92;
sheet.Range["C5"].Number = 39;
sheet.Range["C6"].Number = 55;
//Create a Chart
IChartShape chart = sheet.Charts.Add();
chart.LeftColumn = 5;
chart.RightColumn = 11;
chart.Name = "Student Sample Chart";
chart.ChartType = ExcelChartType.Cone_Clustered_3D;
chart.DataRange = sheet.Range["B2:C6"];
//Sets the index border colour for plot area
chart.ChartArea.Border.ColorIndex = ExcelKnownColors.Red;
workbook.SaveAs("Charts.xlsx");
workbook.Close();
}
DrawTickLabels
True to draw tick labels on this axis. otherwise False.
Declaration
bool DrawTickLabels { get; set; }
Property Value
Type |
---|
System.Boolean |
Remarks
To know more about charts refer this link.
Examples
The following code illustrates the use of DrawTickLabels property.
using (ExcelEngine excelEngine = new ExcelEngine())
{
//Create a worksheet.
IApplication application = excelEngine.Excel;
application.DefaultVersion = ExcelVersion.Excel2013;
IWorkbook workbook = application.Workbooks.Create(1);
IWorksheet sheet = workbook.Worksheets[0];
sheet.Range["A1"].Text = "Student ID";
sheet.Range["B1"].Text = "Student Name";
sheet.Range["C1"].Text = "Mark(Out of 100)";
sheet.Range["A1:C1"].AutofitColumns();
sheet.Range["A2"].Number = 1;
sheet.Range["A3"].Number = 2;
sheet.Range["A4"].Number = 3;
sheet.Range["A5"].Number = 4;
sheet.Range["A6"].Number = 5;
sheet.Range["B2"].Text = "Andrew";
sheet.Range["B3"].Text = "Marson";
sheet.Range["B4"].Text = "Jack";
sheet.Range["B5"].Text = "Sam";
sheet.Range["B6"].Text = "Breto";
sheet.Range["C2"].Number = 77;
sheet.Range["C3"].Number = 45;
sheet.Range["C4"].Number = 92;
sheet.Range["C5"].Number = 39;
sheet.Range["C6"].Number = 55;
//Create a Chart
IChartShape chart = sheet.Charts.Add();
chart.LeftColumn = 5;
chart.RightColumn = 11;
chart.Name = "Student Sample Chart";
chart.ChartType = ExcelChartType.Cone_Clustered_3D;
chart.DataRange = sheet.Range["B2:C6"];
//True to draw tick labels on this axis
chart.PrimaryValueAxis.Border.DrawTickLabels = false;
workbook.SaveAs("Charts.xlsx");
workbook.Close();
}
IsAutoLineColor
True for default border line color as in AutoFormat. otherwise False.
Declaration
bool IsAutoLineColor { get; set; }
Property Value
Type |
---|
System.Boolean |
Remarks
To know more about charts refer this link.
Examples
The following code illustrates the use of IsAutoLineColor property.
using (ExcelEngine excelEngine = new ExcelEngine())
{
//Create a worksheet.
IApplication application = excelEngine.Excel;
application.DefaultVersion = ExcelVersion.Excel2013;
IWorkbook workbook = application.Workbooks.Create(1);
IWorksheet sheet = workbook.Worksheets[0];
sheet.Range["A1"].Text = "Student ID";
sheet.Range["B1"].Text = "Student Name";
sheet.Range["C1"].Text = "Mark(Out of 100)";
sheet.Range["A1:C1"].AutofitColumns();
sheet.Range["A2"].Number = 1;
sheet.Range["A3"].Number = 2;
sheet.Range["A4"].Number = 3;
sheet.Range["A5"].Number = 4;
sheet.Range["A6"].Number = 5;
sheet.Range["B2"].Text = "Andrew";
sheet.Range["B3"].Text = "Marson";
sheet.Range["B4"].Text = "Jack";
sheet.Range["B5"].Text = "Sam";
sheet.Range["B6"].Text = "Breto";
sheet.Range["C2"].Number = 77;
sheet.Range["C3"].Number = 45;
sheet.Range["C4"].Number = 92;
sheet.Range["C5"].Number = 39;
sheet.Range["C6"].Number = 55;
//Create a Chart
IChartShape chart = sheet.Charts.Add();
chart.LeftColumn = 5;
chart.RightColumn = 11;
chart.Name = "Student Sample Chart";
chart.ChartType = ExcelChartType.Cone_Clustered_3D;
chart.DataRange = sheet.Range["B2:C6"];
//True to enable default border colour for plot area
chart.ChartArea.Border.IsAutoLineColor = true;
chart.ChartArea.Border.LinePattern = ExcelChartLinePattern.DashDotDot;
workbook.SaveAs("Charts.xlsx");
workbook.Close();
}
LineColor
Gets or sets the border line color.
Declaration
Color LineColor { get; set; }
Property Value
Type |
---|
Color |
Remarks
To know more about charts refer this link.
Examples
The following code illustrates the use of LineColor property.
using (ExcelEngine excelEngine = new ExcelEngine())
{
//Create a worksheet.
IApplication application = excelEngine.Excel;
application.DefaultVersion = ExcelVersion.Excel2013;
IWorkbook workbook = application.Workbooks.Create(1);
IWorksheet sheet = workbook.Worksheets[0];
sheet.Range["A1"].Text = "Student ID";
sheet.Range["B1"].Text = "Student Name";
sheet.Range["C1"].Text = "Mark(Out of 100)";
sheet.Range["A1:C1"].AutofitColumns();
sheet.Range["A2"].Number = 1;
sheet.Range["A3"].Number = 2;
sheet.Range["A4"].Number = 3;
sheet.Range["A5"].Number = 4;
sheet.Range["A6"].Number = 5;
sheet.Range["B2"].Text = "Andrew";
sheet.Range["B3"].Text = "Marson";
sheet.Range["B4"].Text = "Jack";
sheet.Range["B5"].Text = "Sam";
sheet.Range["B6"].Text = "Breto";
sheet.Range["C2"].Number = 77;
sheet.Range["C3"].Number = 45;
sheet.Range["C4"].Number = 92;
sheet.Range["C5"].Number = 39;
sheet.Range["C6"].Number = 55;
//Create a Chart
IChartShape chart = sheet.Charts.Add();
chart.LeftColumn = 5;
chart.RightColumn = 11;
chart.Name = "Student Sample Chart";
chart.ChartType = ExcelChartType.Cone_Clustered_3D;
chart.DataRange = sheet.Range["B2:C6"];
//Set line color for chart area border
chart.ChartArea.Border.LineColor = System.Drawing.Color.DarkOrange;
workbook.SaveAs("Charts.xlsx");
workbook.Close();
}
LinePattern
Gets or sets the border line pattern.
Declaration
ExcelChartLinePattern LinePattern { get; set; }
Property Value
Type |
---|
ExcelChartLinePattern |
Remarks
To know more about charts refer this link.
Examples
The following code illustrates the use of LinePattern property.
using (ExcelEngine excelEngine = new ExcelEngine())
{
//Create a worksheet.
IApplication application = excelEngine.Excel;
application.DefaultVersion = ExcelVersion.Excel2013;
IWorkbook workbook = application.Workbooks.Create(1);
IWorksheet sheet = workbook.Worksheets[0];
sheet.Range["A1"].Text = "Student ID";
sheet.Range["B1"].Text = "Student Name";
sheet.Range["C1"].Text = "Mark(Out of 100)";
sheet.Range["A1:C1"].AutofitColumns();
sheet.Range["A2"].Number = 1;
sheet.Range["A3"].Number = 2;
sheet.Range["A4"].Number = 3;
sheet.Range["A5"].Number = 4;
sheet.Range["A6"].Number = 5;
sheet.Range["B2"].Text = "Andrew";
sheet.Range["B3"].Text = "Marson";
sheet.Range["B4"].Text = "Jack";
sheet.Range["B5"].Text = "Sam";
sheet.Range["B6"].Text = "Breto";
sheet.Range["C2"].Number = 77;
sheet.Range["C3"].Number = 45;
sheet.Range["C4"].Number = 92;
sheet.Range["C5"].Number = 39;
sheet.Range["C6"].Number = 55;
//Create a Chart
IChartShape chart = sheet.Charts.Add();
chart.LeftColumn = 5;
chart.RightColumn = 11;
chart.Name = "Student Sample Chart";
chart.ChartType = ExcelChartType.Cone_Clustered_3D;
chart.DataRange = sheet.Range["B2:C6"];
//Set line pattern for plot area border
chart.ChartArea.Border.LinePattern = ExcelChartLinePattern.DashDotDot;
workbook.SaveAs("Charts.xlsx");
workbook.Close();
}
LineWeight
Gets or sets the border line weight.
Declaration
ExcelChartLineWeight LineWeight { get; set; }
Property Value
Type |
---|
ExcelChartLineWeight |
Remarks
To know more about charts refer this link.
Examples
The following code illustrates the use of LineWeight property.
using (ExcelEngine excelEngine = new ExcelEngine())
{
//Create a worksheet.
IApplication application = excelEngine.Excel;
application.DefaultVersion = ExcelVersion.Excel2013;
IWorkbook workbook = application.Workbooks.Create(1);
IWorksheet sheet = workbook.Worksheets[0];
sheet.Range["A1"].Text = "Student ID";
sheet.Range["B1"].Text = "Student Name";
sheet.Range["C1"].Text = "Mark(Out of 100)";
sheet.Range["A1:C1"].AutofitColumns();
sheet.Range["A2"].Number = 1;
sheet.Range["A3"].Number = 2;
sheet.Range["A4"].Number = 3;
sheet.Range["A5"].Number = 4;
sheet.Range["A6"].Number = 5;
sheet.Range["B2"].Text = "Andrew";
sheet.Range["B3"].Text = "Marson";
sheet.Range["B4"].Text = "Jack";
sheet.Range["B5"].Text = "Sam";
sheet.Range["B6"].Text = "Breto";
sheet.Range["C2"].Number = 77;
sheet.Range["C3"].Number = 45;
sheet.Range["C4"].Number = 92;
sheet.Range["C5"].Number = 39;
sheet.Range["C6"].Number = 55;
//Create a Chart
IChartShape chart = sheet.Charts.Add();
chart.LeftColumn = 5;
chart.RightColumn = 11;
chart.Name = "Student Sample Chart";
chart.ChartType = ExcelChartType.Cone_Clustered_3D;
chart.DataRange = sheet.Range["B2:C6"];
//Set line weight for plot area border
chart.ChartArea.Border.LineWeight = ExcelChartLineWeight.Narrow;
chart.ChartArea.Border.LineColor = System.Drawing.Color.DarkOrange;
workbook.SaveAs("Charts.xlsx");
workbook.Close();
}
Transparency
Gets or sets the transparency level of the solid color shaded fill as a floating-point value from 0.0 (Clear) through 1.0 (Opaque).
Declaration
double Transparency { get; set; }
Property Value
Type |
---|
System.Double |
Remarks
To know more about charts refer this link.
Examples
The following code illustrates the use of Transparency property.
using (ExcelEngine excelEngine = new ExcelEngine())
{
//Create a worksheet.
IApplication application = excelEngine.Excel;
application.DefaultVersion = ExcelVersion.Excel2013;
IWorkbook workbook = application.Workbooks.Create(1);
IWorksheet sheet = workbook.Worksheets[0];
sheet.Range["A1"].Text = "Student ID";
sheet.Range["B1"].Text = "Student Name";
sheet.Range["C1"].Text = "Mark(Out of 100)";
sheet.Range["A1:C1"].AutofitColumns();
sheet.Range["A2"].Number = 1;
sheet.Range["A3"].Number = 2;
sheet.Range["A4"].Number = 3;
sheet.Range["A5"].Number = 4;
sheet.Range["A6"].Number = 5;
sheet.Range["B2"].Text = "Andrew";
sheet.Range["B3"].Text = "Marson";
sheet.Range["B4"].Text = "Jack";
sheet.Range["B5"].Text = "Sam";
sheet.Range["B6"].Text = "Breto";
sheet.Range["C2"].Number = 77;
sheet.Range["C3"].Number = 45;
sheet.Range["C4"].Number = 92;
sheet.Range["C5"].Number = 39;
sheet.Range["C6"].Number = 55;
//Create a Chart
IChartShape chart = sheet.Charts.Add();
chart.LeftColumn = 5;
chart.RightColumn = 11;
chart.Name = "Student Sample Chart";
chart.ChartType = ExcelChartType.Cone_Clustered_3D;
chart.DataRange = sheet.Range["B2:C6"];
//sets the transparency level of the solid color
chart.ChartArea.Border.Transparency =0.75;
chart.ChartArea.Border.ColorIndex = ExcelKnownColors.Red;
workbook.SaveAs("Charts.xlsx");
workbook.Close();
}
Weight
Gets or sets the border line weight as number. Set -1 for Hairline, 0 for Narrow, 1 for Medium, 2 for Wide.
Declaration
double Weight { get; set; }
Property Value
Type |
---|
System.Double |
Remarks
To know more about charts refer this link.
Examples
The following code illustrates the use of Weight property.
using (ExcelEngine excelEngine = new ExcelEngine())
{
//Create a worksheet.
IApplication application = excelEngine.Excel;
application.DefaultVersion = ExcelVersion.Excel2013;
IWorkbook workbook = application.Workbooks.Create(1);
IWorksheet sheet = workbook.Worksheets[0];
sheet.Range["A1"].Text = "Student ID";
sheet.Range["B1"].Text = "Student Name";
sheet.Range["C1"].Text = "Mark(Out of 100)";
sheet.Range["A1:C1"].AutofitColumns();
sheet.Range["A2"].Number = 1;
sheet.Range["A3"].Number = 2;
sheet.Range["A4"].Number = 3;
sheet.Range["A5"].Number = 4;
sheet.Range["A6"].Number = 5;
sheet.Range["B2"].Text = "Andrew";
sheet.Range["B3"].Text = "Marson";
sheet.Range["B4"].Text = "Jack";
sheet.Range["B5"].Text = "Sam";
sheet.Range["B6"].Text = "Breto";
sheet.Range["C2"].Number = 77;
sheet.Range["C3"].Number = 45;
sheet.Range["C4"].Number = 92;
sheet.Range["C5"].Number = 39;
sheet.Range["C6"].Number = 55;
//Create a Chart
IChartShape chart = sheet.Charts.Add();
chart.LeftColumn = 5;
chart.RightColumn = 11;
chart.Name = "Student Sample Chart";
chart.ChartType = ExcelChartType.Cone_Clustered_3D;
chart.DataRange = sheet.Range["B2:C6"];
//Set line weight for plot area border
chart.ChartArea.Border.Weight = 7.5;
chart.ChartArea.Border.LineColor = System.Drawing.Color.DarkOrange;
workbook.SaveAs("Charts.xlsx");
workbook.Close();
}