Interface IShadow
Represents shadow in the chart
Namespace: Syncfusion.XlsIO
Assembly: Syncfusion.XlsIO.Base.dll
Syntax
public interface IShadow
Properties
Angle
Gets or sets the angle of Shadow.
Declaration
int Angle { get; set; }
Property Value
Type | Description |
---|---|
System.Int32 | The angle. |
Remarks
To know more about charts refer this link.
Examples
The following code illustrates the use of Angle 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 angle of Shadow
chart.ChartArea.Shadow.Angle = 120;
chart.ChartArea.Shadow.ShadowPrespectivePresets = Excel2007ChartPresetsPrespective.Below;
workbook.SaveAs("Charts.xlsx");
workbook.Close();
}
Blur
Gets or sets the blur of Shadow.
Declaration
int Blur { get; set; }
Property Value
Type | Description |
---|---|
System.Int32 | The blur. |
Remarks
To know more about charts refer this link.
Examples
The following code illustrates the use of Blur 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 blur of Shadow
chart.ChartArea.Shadow.Blur = 42;
chart.ChartArea.Shadow.ShadowPrespectivePresets = Excel2007ChartPresetsPrespective.Below;
workbook.SaveAs("Charts.xlsx");
workbook.Close();
}
Distance
Gets or sets the distance of Shadow.
Declaration
int Distance { get; set; }
Property Value
Type | Description |
---|---|
System.Int32 | The distance. |
Remarks
To know more about charts refer this link.
Examples
The following code illustrates the use of Distance 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 distance of Shadow.
chart.ChartArea.Shadow.Distance = 86;
chart.ChartArea.Shadow.ShadowPrespectivePresets = Excel2007ChartPresetsPrespective.Below;
workbook.SaveAs("Charts.xlsx");
workbook.Close();
}
HasCustomShadowStyle
Gets or sets a value indicating whether this instance has custom shadow style.
Declaration
bool HasCustomShadowStyle { get; set; }
Property Value
Type | Description |
---|---|
System.Boolean |
|
Remarks
To know more about charts refer this link.
Examples
The following code illustrates the use of HasCustomShadowStyle 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 value indicating whether this instance has custom shadow style.
chart.ChartArea.Shadow.CustomShadowStyles(Excel2007ChartPresetsInner.InsideCenter, 70, 71, 50, 60, true);
bool hasCustomShadow = chart.ChartArea.Shadow.HasCustomShadowStyle;
if(hasCustomShadow)
{
//your code here
}
workbook.SaveAs("Charts.xlsx");
workbook.Close();
}
ShadowColor
Gets or sets the color of the shadow.
Declaration
Color ShadowColor { get; set; }
Property Value
Type | Description |
---|---|
System.Drawing.Color | The color of the shadow. |
Remarks
To know more about charts refer this link.
Examples
The following code illustrates the use of ShadowColor 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 blur of Shadow
chart.ChartArea.Shadow.ShadowColor = System.Drawing.Color.Red;
chart.ChartArea.Shadow.ShadowPrespectivePresets = Excel2007ChartPresetsPrespective.Below;
workbook.SaveAs("Charts.xlsx");
workbook.Close();
}
ShadowInnerPresets
Gets or sets the shadow inner presets.
Declaration
Excel2007ChartPresetsInner ShadowInnerPresets { get; set; }
Property Value
Type | Description |
---|---|
Excel2007ChartPresetsInner | The shadow inner presets. |
Remarks
To know more about charts refer this link.
Examples
The following code illustrates the use of ShadowInnerPresets 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 shadow inner presets
chart.ChartArea.Shadow.ShadowInnerPresets = Excel2007ChartPresetsInner.InsideDiagonalTopLeft;
workbook.SaveAs("Charts.xlsx");
workbook.Close();
}
ShadowOuterPresets
Gets or sets the shadow outer presets.
Declaration
Excel2007ChartPresetsOuter ShadowOuterPresets { get; set; }
Property Value
Type | Description |
---|---|
Excel2007ChartPresetsOuter | The shadow outer presets. |
Remarks
To know more about charts refer this link.
Examples
The following code illustrates the use of ShadowOuterPresets 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 shadow outer presets
chart.ChartArea.Shadow.ShadowOuterPresets = Excel2007ChartPresetsOuter.OffsetBottom;
workbook.SaveAs("Charts.xlsx");
workbook.Close();
}
ShadowPrespectivePresets
Gets or sets the shadow prespective presets.
Declaration
Excel2007ChartPresetsPrespective ShadowPrespectivePresets { get; set; }
Property Value
Type | Description |
---|---|
Excel2007ChartPresetsPrespective | The shadow prespective presets. |
Remarks
To know more about charts refer this link.
Examples
The following code illustrates the use of ShadowPrespectivePresets 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 shadow prespective presets
chart.ChartArea.Shadow.ShadowPrespectivePresets = Excel2007ChartPresetsPrespective.Below;
workbook.SaveAs("Charts.xlsx");
workbook.Close();
}
Size
Gets or sets the size of Shadow.
Declaration
int Size { get; set; }
Property Value
Type | Description |
---|---|
System.Int32 | The size. |
Remarks
To know more about charts refer this link.
Examples
The following code illustrates the use of Size 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 size of Shadow
chart.ChartArea.Shadow.Size = 111;
chart.ChartArea.Shadow.ShadowPrespectivePresets = Excel2007ChartPresetsPrespective.Below;
workbook.SaveAs("Charts.xlsx");
workbook.Close();
}
Transparency
Gets or sets the transparency of Shadow.
Declaration
int Transparency { get; set; }
Property Value
Type | Description |
---|---|
System.Int32 | The transparency. |
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 of Shadow
chart.ChartArea.Shadow.Transparency = 50;
chart.ChartArea.Shadow.ShadowPrespectivePresets = Excel2007ChartPresetsPrespective.Below;
workbook.SaveAs("Charts.xlsx");
workbook.Close();
}
Methods
CustomShadowStyles(Excel2007ChartPresetsInner, Int32, Int32, Int32, Int32, Boolean)
Customs the inner shadow styles.
Declaration
void CustomShadowStyles(Excel2007ChartPresetsInner iInner, int iTransparency, int iBlur, int iAngle, int iDistance, bool iCustomShadowStyle)
Parameters
Type | Name | Description |
---|---|---|
Excel2007ChartPresetsInner | iInner | Value from Excel2007ChartPresetsInner. |
System.Int32 | iTransparency | Transparency of the Shadow accepts the values between(0-100). |
System.Int32 | iBlur | Blur level of the Shadow accepts the values between(0-100). |
System.Int32 | iAngle | Angle or Direction of the Shadow accepts the values between(0-359). |
System.Int32 | iDistance | Distance of the Shadow accepts the values between(0-200). |
System.Boolean | iCustomShadowStyle | if set to |
Remarks
To know more about charts refer this link.
Examples
The following code illustrates how to use the CustomShadowStyles method with Excel2007ChartPresetsInner.
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"];
//Customs the inner shadow styles
chart.ChartArea.Shadow.CustomShadowStyles(Excel2007ChartPresetsInner.InsideCenter, 70, 71, 50, 60, true);
workbook.SaveAs("Charts.xlsx");
workbook.Close();
}
CustomShadowStyles(Excel2007ChartPresetsOuter, Int32, Int32, Int32, Int32, Int32, Boolean)
Customs the outer shadow styles.
Declaration
void CustomShadowStyles(Excel2007ChartPresetsOuter iOuter, int iTransparency, int iSize, int iBlur, int iAngle, int iDistance, bool iCustomShadowStyle)
Parameters
Type | Name | Description |
---|---|---|
Excel2007ChartPresetsOuter | iOuter | Value from Excel2007ChartPresetsOuter. |
System.Int32 | iTransparency | Transparency of the Shadow accepts the values between(0-100). |
System.Int32 | iSize | Size of the Shadow accepts the values between(0-200). |
System.Int32 | iBlur | Blur level of the Shadow accepts the values between(0-100). |
System.Int32 | iAngle | Angle or Direction of the Shadow accepts the values between(0-359). |
System.Int32 | iDistance | Distance of the Shadow accepts the values between(0-200). |
System.Boolean | iCustomShadowStyle | if set to |
Remarks
To know more about charts refer this link.
Examples
The following code illustrates how to use the CustomShadowStyles method with Excel2007ChartPresetsOuter.
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"];
//Customs the outer shadow styles
chart.ChartArea.Shadow.CustomShadowStyles(Excel2007ChartPresetsOuter.OffsetBottom, 70, 90, 71, 50, 60, true);
workbook.SaveAs("Charts.xlsx");
workbook.Close();
}
CustomShadowStyles(Excel2007ChartPresetsPrespective, Int32, Int32, Int32, Int32, Int32, Boolean)
Customs the perspective shadow styles.
Declaration
void CustomShadowStyles(Excel2007ChartPresetsPrespective iPerspective, int iTransparency, int iSize, int iBlur, int iAngle, int iDistance, bool iCustomShadowStyle)
Parameters
Type | Name | Description |
---|---|---|
Excel2007ChartPresetsPrespective | iPerspective | Value from Excel2007ChartPresetsPrespective. |
System.Int32 | iTransparency | Transparency of the Shadow accepts the values between(0-100). |
System.Int32 | iSize | Size of the Shadow accepts the values between(0-200). |
System.Int32 | iBlur | Blur level of the Shadow accepts the values between(0-100). |
System.Int32 | iAngle | Angle or Direction of the Shadow accepts the values between(0-359). |
System.Int32 | iDistance | Distance of the Shadow accepts the values between(0-200). |
System.Boolean | iCustomShadowStyle | if set to |
Remarks
To know more about charts refer this link.
Examples
The following code illustrates how to use the CustomShadowStyles method with Excel2007ChartPresetsPrespective.
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"];
//Customs the perspective shadow styles
chart.ChartArea.Shadow.CustomShadowStyles(Excel2007ChartPresetsPrespective.Below, 70, 90, 71, 50, 60, true);
workbook.SaveAs("Charts.xlsx");
workbook.Close();
}