Skip to main content

SurfaceSeries Class

A surface series in a standard chart.

Declaration

public class SurfaceSeries extends SeriesBase

Remarks

Add SurfaceSeries objects to the Chart.getSeries() collection to create a surface chart. The chart creates a SurfaceChartView object for the series.

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

com.devexpress.system.JavaObject.clone()
com.devexpress.system.JavaObject.equals(java.lang.Object)
com.devexpress.system.JavaObject.hashCode()
com.devexpress.system.JavaObject.memberwiseClone()
com.devexpress.system.JavaObject.toString()
java.lang.Object.finalize()
java.lang.Object.getClass()
java.lang.Object.notify()
java.lang.Object.notifyAll()
java.lang.Object.wait()
java.lang.Object.wait(long)
java.lang.Object.wait(long,int)

Inheritance

Object
JavaObject
See Also

SurfaceSeries()

Initializes a new instance of the SurfaceSeries class.

Declaration

public SurfaceSeries()