Note
Access to this page requires authorization. You can try signing in or changing directories.
Access to this page requires authorization. You can try changing directories.
Gets or sets the style of the chart.
Namespace: Microsoft.Office.Tools.Excel
Assembly: Microsoft.Office.Tools.Excel.v9.0 (in Microsoft.Office.Tools.Excel.v9.0.dll)
Syntax
'Declaration
<BrowsableAttribute(False)> _
Public Property ChartStyle As Object
'Usage
Dim instance As ChartSheet
Dim value As Object
value = instance.ChartStyle
instance.ChartStyle = value
[BrowsableAttribute(false)]
public Object ChartStyle { get; set; }
[BrowsableAttribute(false)]
public:
property Object^ ChartStyle {
Object^ get ();
void set (Object^ value);
}
public function get ChartStyle () : Object
public function set ChartStyle (value : Object)
Property Value
Type: System.Object
An integer from 1 through 48 that represents the style of the chart.
Remarks
The values of the ChartStyle property correspond to the available options on the Chart Styles group on the Design tab on the Ribbon. The Design tab is available when you select a chart.
Examples
The following code example specifies the colors of the walls and floor of an existing 3-D chart sheet and sets the chart style to style 4. To run this code example, the workbook must contain a chart sheet called Chart1 of a 3-D type.
Private Sub SetChartSheetDesign()
' Add a new chart and populate source data
Dim myChartSheet As Microsoft.Office.Tools.Excel.ChartSheet = _
Globals.Chart1
myChartSheet.BackWall.Format.Fill.ForeColor.RGB = _
System.Drawing.Color.LightGray.ToArgb()
myChartSheet.SideWall.Format.Fill.ForeColor.RGB = _
System.Drawing.Color.LightGray.ToArgb()
myChartSheet.Floor.Format.Fill.ForeColor.RGB = _
System.Drawing.Color.Gray.ToArgb()
myChartSheet.ChartStyle = 4
End Sub
private void SetChartSheetDesign()
{
// Add a new chart and populate source data
Microsoft.Office.Tools.Excel.ChartSheet myChartSheet =
Globals.Chart1;
myChartSheet.BackWall.Format.Fill.ForeColor.RGB =
System.Drawing.Color.LightGray.ToArgb();
myChartSheet.SideWall.Format.Fill.ForeColor.RGB =
System.Drawing.Color.LightGray.ToArgb();
myChartSheet.Floor.Format.Fill.ForeColor.RGB =
System.Drawing.Color.Gray.ToArgb();
myChartSheet.ChartStyle = 4;
}
.NET Framework Security
- Full trust for the immediate caller. This member cannot be used by partially trusted code. For more information, see Using Libraries from Partially Trusted Code.