Skip to main content

SeriesExBase Class

The base class for series in chart types introduced in Microsoft Excel 2016.

Declaration

public abstract class SeriesExBase extends OfficeObject

Remarks

Call the ChartEx.getSeries() method to access series of a chart of a type introduced in Microsoft Excel 2016. To create a series, add a descendant class object (for example, FunnelSeries or WaterfallSeries) to the collection.

Refer to the following help topic for additional information: Create Waterfall, Funnel, Treemap, and Other Office 2016 Charts — Presentation API for Java.

Example: Specify the Name and Fill of a Funnel Series

The following code snippet creates a funnel chart and specifies the series name and fill color:

import java.io.*;
import java.nio.file.*;
import java.util.List;
import com.devexpress.docs.office.*;
import com.devexpress.docs.presentation.*;
import com.devexpress.system.drawing.*;

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.
            ChartEx chart = new ChartEx();
            chart.setWidth(presentation.getSlideSize().getWidth());
            chart.setHeight(presentation.getSlideSize().getHeight());
            slide.getShapes().add(chart);

            // Create a funnel series and specify data.
            FunnelSeries series = new FunnelSeries();
            series.setArguments(new ChartStringData(List.of("Leads", "Prospects", "Proposals", "Deals")));
            series.setValues(new ChartNumericData(List.of(500.0, 320.0, 140.0, 60.0)));

            // Specify the series name and fill.
            series.setText("Sales Pipeline");
            ChartElement seriesProperties = new ChartElement();
            seriesProperties.setFill(new SolidFill(Color.getSeaGreen()));
            series.setProperties(seriesProperties);
            chart.getSeries().add(series);

            // 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.initFields()
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
OfficeObject
SeriesExBase
See Also

SeriesExBase()

Initializes a new instance of the SeriesExBase class.

Declaration

public SeriesExBase()

Methods

deepClone() Method

Creates a copy of the series.

Declaration

public SeriesExBase deepClone()

Returns

Type Description
SeriesExBase

A copy of the series.

getChartType() Method

Returns the chart type of the series.

Declaration

public abstract ChartExType getChartType()

Returns

Type Description
ChartExType

The chart type.

Remarks

The getChartType() method returns one of the following values:

Value Description
BOX_AND_WHISKER Indicates a box and whisker chart.
FUNNEL Indicates a funnel chart.
HISTOGRAM Indicates a histogram chart.
PARETO Indicates a Pareto chart.
SUNBURST Indicates a sunburst chart.
TREEMAP Indicates a treemap chart.
WATERFALL Indicates a waterfall chart.
MAP Indicates a map chart.

getCustomDataPoints() Method

Returns custom settings for individual data points.

Declaration

public IDataPointExDictionary getCustomDataPoints()

Returns

Type Description
IDataPointExDictionary

A dictionary of custom data point settings, or null if you passed null to the setCustomDataPoints(value) method.

getHidden() Method

Returns whether the series is hidden.

Declaration

public boolean getHidden()

Returns

Type Description
boolean

true if the series is hidden; otherwise, false.

getProperties() Method

Returns fill, outline, and effect settings for the series.

Declaration

public ChartElement getProperties()

Returns

Type Description
ChartElement

Series appearance settings, or null if the series has no custom appearance settings.

getText() Method

Returns the series name.

Declaration

public String getText()

Returns

Type Description
String

The series name.

setCustomDataPoints(Map<Integer,DataPointEx> value) Method

Sets custom settings for individual data points.

Declaration

public void setCustomDataPoints(Map<Integer,DataPointEx> value)

Parameters

Name Type Description
value java.util.Map<java.lang.Integer,DataPointEx>

A map of data point indexes and custom data point settings.

Remarks

To customize an individual data point, add a DataPointEx object to the dictionary that the getCustomDataPoints() method returns. The dictionary key is the zero-based index of the data point.

The setCustomDataPoints(value) method copies entries of the passed map. Later changes to the passed map do not affect the series.

setHidden(boolean value) Method

Sets whether to hide the series.

Declaration

public void setHidden(boolean value)

Parameters

Name Type Description
value boolean

true to hide the series; otherwise, false.

setProperties(ChartElement value) Method

Sets fill, outline, and effect settings for the series.

Declaration

public void setProperties(ChartElement value)

Parameters

Name Type Description
value ChartElement

Series appearance settings.

setText(String value) Method

Sets the series name.

Declaration

public void setText(String value)

Parameters

Name Type Description
value String

The series name.