Skip to main content

MapSeries Class

A series in a map chart.

Declaration

public class MapSeries extends DataSeriesExBase

Remarks

Add a MapSeries object to the ChartEx.getSeries() collection to create a map chart. To specify countries or regions, call the MapSeries.setArguments(value) method. To specify values, call the MapSeries.setValues(value) method.

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

Example: Create a Map Chart

The following code snippet creates a map chart that displays sales values for three countries:

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

            // Create a map series and specify data.
            MapSeries series = new MapSeries();
            series.setText("Sales by Country");
            series.setArguments(new ChartStringData(List.of("United States", "Canada", "Mexico")));
            series.setValues(new ChartNumericData(List.of(120.0, 80.0, 45.0)));
            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.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

See Also

MapSeries()

Initializes a new instance of the MapSeries class.

Declaration

public MapSeries()

Methods

deepClone() Method

Creates a copy of the map series.

Declaration

public MapSeries deepClone()

Returns

Type Description
MapSeries

A copy of the map series.

getChartType() Method

Returns the chart type of the series.

Declaration

public ChartExType getChartType()

Returns

Type Description
ChartExType

ChartExType.MAP.