SurfaceChartView Class
Contains settings that apply to surface series in a chart view.
Declaration
public class SurfaceChartView extends SurfaceChartViewBase
Remarks
When you add a SurfaceSeries object to a chart, the chart creates a SurfaceChartView object for the series. Call the Chart.getViews() method to access chart views.
Call the SurfaceChartView.setDisplayAsWireframe(value) method to display the surface as a wireframe. Call the SurfaceChartView.getBandFormats() method to access formatting settings for surface bands.
Refer to the following help topic for additional information: Create Standard Charts — Presentation API for Java.
Example
Create a Wireframe Surface Chart
The following code snippet creates a surface chart with four series and displays the surface as a wireframe:
import java.io.*;
import java.nio.file.*;
import java.util.List;
import com.devexpress.docs.office.*;
import com.devexpress.docs.presentation.*;
public class Main {
public static void main(String[] args) throws Exception {
try (Presentation presentation = new Presentation()) {
// Add a blank slide.
presentation.getSlides().clear();
Slide slide = new Slide(SlideLayoutType.BLANK);
presentation.getSlides().add(slide);
// Insert a chart that fills the slide.
Chart chart = new Chart();
chart.setWidth(presentation.getSlideSize().getWidth());
chart.setHeight(presentation.getSlideSize().getHeight());
slide.getShapes().add(chart);
// Add a surface series for each data row.
String[] names = { "Row 1", "Row 2", "Row 3", "Row 4" };
double[][] values = {
{ 10, 25, 30, 20, 15 },
{ 20, 40, 55, 35, 25 },
{ 15, 35, 45, 40, 20 },
{ 5, 15, 25, 20, 10 }
};
for (int i = 0; i < names.length; i++) {
SurfaceSeries series = new SurfaceSeries();
series.setText(names[i]);
series.setArguments(new ChartStringData(List.of("A", "B", "C", "D", "E")));
series.setValues(new ChartNumericData(List.of(values[i][0], values[i][1], values[i][2], values[i][3], values[i][4])));
chart.getSeries().add(series);
}
// Display the surface as a wireframe.
SurfaceChartView view = (SurfaceChartView) chart.getViews().get(0);
view.setDisplayAsWireframe(true);
// Save the presentation.
Files.createDirectories(Path.of("output"));
try (OutputStream output = Files.newOutputStream(Path.of("output", "Chart.pptx"))) {
presentation.save(output);
}
}
}
}
Inherited Members
Inheritance
SurfaceChartView()
Initializes a new instance of the SurfaceChartView class.
Declaration
public SurfaceChartView()
Methods
getChartType() Method
Returns the chart type of the view.
Declaration
public ChartType getChartType()
Returns
| Type | Description |
|---|---|
| ChartType |
|