officefileapi-devexpress-dot-spreadsheet-dot-charts-dot-view3doptions.md
Contains display options for three-dimensional charts.
Namespace : DevExpress.Spreadsheet.Charts
Assembly : DevExpress.Spreadsheet.v25.2.Core.dll
NuGet Package : DevExpress.Spreadsheet.Core
public interface View3DOptions
Public Interface View3DOptions
The following members return View3DOptions objects:
To access an object exposing the View3DOptions interface, use the ChartObject.View3D property. Utilize the object’s members to format the back wall (View3DOptions.BackWall), side wall (View3DOptions.SideWall) and floor (View3DOptions.Floor) of a 3-D chart; specify its depth (View3DOptions.DepthPercent), height (View3DOptions.HeightPercent) and perspective (View3DOptions.Perspective), or rotate the chart around the X-axis (View3DOptions.XRotation) or Y-axis (View3DOptions.YRotation).
The example below demonstrates how to create the 3-D clustered column chart and adjust its appearance. In particular, the code specifies how to customize the chart walls and floor by using the View3DOptions.BackWall, View3DOptions.SideWall and View3DOptions.Floor properties.
Worksheet worksheet = workbook.Worksheets["chartTask5"];
workbook.Worksheets.ActiveWorksheet = worksheet;
// Create a chart and specify its location.
Chart chart = worksheet.Charts.Add(ChartType.Column3DClustered, worksheet["B2:C8"]);
chart.TopLeftCell = worksheet.Cells["F2"];
chart.BottomRightCell = worksheet.Cells["L15"];
// Specify that each data point in the series has a different color.
chart.Views[0].VaryColors = true;
// Specify the series outline.
chart.Series[0].Outline.SetSolidFill(Color.AntiqueWhite);
// Hide the legend.
chart.Legend.Visible = false;
// Specify the side wall color.
chart.View3D.SideWall.Fill.SetSolidFill(Color.FromArgb(0xDC, 0xFA, 0xDD));
// Specify the pattern fill for the back wall.
chart.View3D.BackWall.Fill.SetPatternFill(Color.FromArgb(0x9C, 0xFB, 0x9F), Color.WhiteSmoke, DevExpress.Spreadsheet.Drawings.ShapeFillPatternType.DiagonalBrick);
SurfaceOptions floorOptions = chart.View3D.Floor;
// Specify the floor color.
floorOptions.Fill.SetSolidFill(Color.FromArgb(0xFA, 0xDC, 0xF9));
// Specify the floor border.
floorOptions.Outline.SetSolidFill(Color.FromArgb(0xB4, 0x95, 0xDE));
floorOptions.Outline.Width = 1.25;
Dim worksheet As Worksheet = workbook.Worksheets("chartTask5")
workbook.Worksheets.ActiveWorksheet = worksheet
' Create a chart and specify its location.
Dim chart As Chart = worksheet.Charts.Add(ChartType.Column3DClustered, worksheet("B2:C8"))
chart.TopLeftCell = worksheet.Cells("F2")
chart.BottomRightCell = worksheet.Cells("L15")
' Specify that each data point in the series has a different color.
chart.Views(0).VaryColors = True
' Specify the series outline.
chart.Series(0).Outline.SetSolidFill(Color.AntiqueWhite)
' Hide the legend.
chart.Legend.Visible = False
' Specify the side wall color.
chart.View3D.SideWall.Fill.SetSolidFill(Color.FromArgb(&HDC, &HFA, &HDD))
' Specify the pattern fill for the back wall.
chart.View3D.BackWall.Fill.SetPatternFill(Color.FromArgb(&H9C, &HFB, &H9F), Color.WhiteSmoke, DevExpress.Spreadsheet.Drawings.ShapeFillPatternType.DiagonalBrick)
Dim floorOptions As SurfaceOptions = chart.View3D.Floor
' Specify the floor color.
floorOptions.Fill.SetSolidFill(Color.FromArgb(&HFA, &HDC, &HF9))
' Specify the floor border.
floorOptions.Outline.SetSolidFill(Color.FromArgb(&HB4, &H95, &HDE))
floorOptions.Outline.Width = 1.25
See Also