Surface3DChartView Class
A view for 3D surface charts.
Namespace: DevExpress.Docs.Office
Assembly: DevExpress.Docs.Core.v26.1.dll
NuGet Package: DevExpress.Docs.Core
Declaration
Remarks
For additional information about views, refer to the following help topic: Series and Views.
Example
The following code snippet adds a surface chart to a presentation:
using DevExpress.Docs.Office;
using DevExpress.Docs.Presentation;
using System.Drawing;
namespace PresentationApiSample {
public class Program {
public static async Task Main(string[] _) {
// Create a presentation.
Presentation presentation = new Presentation();
// Reset the slide collection.
presentation.Slides.Clear();
// Add a blank slide.
Slide slide = new Slide(SlideLayoutType.Blank);
presentation.Slides.Add(slide);
// Insert a chart on the slide.
Chart chart = new Chart();
slide.Shapes.Add(chart);
// Set chart size to match the slide.
chart.Width = presentation.SlideSize.Width;
chart.Height = presentation.SlideSize.Height;
// Add the first data series.
Surface3DSeries series1 = new Surface3DSeries();
chart.Series.Add(series1);
// Specify category arguments and values for the first series.
series1.Arguments = new ChartStringData(new string[] { "Category 1", "Category 2", "Category 3", "Category 4", "Category 5" });
series1.Values = new ChartNumericData(new[] { 1.0, 2.0, 3.0, 4.0, 5.0 });
// Add the second data series.
Surface3DSeries series2 = new Surface3DSeries();
chart.Series.Add(series2);
// Specify category arguments and values for the second series.
series2.Arguments = new ChartStringData(new string[] { "Category 1", "Category 2", "Category 3", "Category 4", "Category 5" });
series2.Values = new ChartNumericData(new[] { 4.3, 2.8, 3.4, 4.2, 5.0 });
// Add the third data series.
Surface3DSeries series3 = new Surface3DSeries();
chart.Series.Add(series3);
// Specify category arguments and values for the third series.
series3.Arguments = new ChartStringData(new string[] { "Category 1", "Category 2", "Category 3", "Category 4", "Category 5" });
series3.Values = new ChartNumericData(new[] { 2.2, 2.9, 3.1, 4.9, 5.5 });
// Access the surface chart view and apply a custom band color.
Surface3DChartView? view = chart.Views[0] as Surface3DChartView;
view.BandFormats[2] = new BandFormat { Fill = new SolidFill(Color.Red) };
// Configure 3D chart appearance and rotation.
chart.View3D = new View3DOptions {
SideWall = new SurfaceOptions { Fill = new SolidFill(Color.AliceBlue), Thickness = 2, OutlineStyle = new OutlineStyle { Fill = new SolidFill(Color.GreenYellow) } },
XRotation = 20, YRotation = 30
};
// Save the presentation to a file.
var outputPath = @"D:\presentation.pptx";
using FileStream outputStream = new(outputPath, FileMode.Create, FileAccess.Write, FileShare.None);
presentation.SaveDocument(outputStream);
}
}
Implements
Inheritance
Object
OfficeObject
ChartViewBase
SurfaceChartViewBase
Surface3DChartView
See Also