Skip to main content

RadarSeries Class

A radar series in a standard chart.

Declaration

public class RadarSeries extends SeriesBase

Remarks

Add a RadarSeries object to the Chart.getSeries() collection to create a radar chart. The chart creates a RadarChartView object for the series.

A radar chart displays series values on axes that start from the chart center. Each category has its own axis. Call the RadarChartView.setStyle(value) method to display series as lines with markers or as filled areas.

Refer to the following help topic for additional information: Create Standard Charts — Presentation API for Java.

Example

Create a Filled Radar Chart

The following code snippet creates a filled radar chart that compares two products and displays a data label for one data point:

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 radar series for each product.
            String[] names = { "Product A", "Product B" };
            double[][] scores = { { 8, 6, 9, 5, 7 }, { 6, 9, 5, 8, 6 } };
            for (int i = 0; i < names.length; i++) {
                RadarSeries series = new RadarSeries();
                series.setText(names[i]);
                series.setArguments(new ChartStringData(List.of("Price", "Quality", "Design", "Support", "Delivery")));
                series.setValues(new ChartNumericData(List.of(scores[i][0], scores[i][1], scores[i][2], scores[i][3], scores[i][4])));
                chart.getSeries().add(series);
            }

            // Display series as filled areas.
            RadarChartView view = (RadarChartView) chart.getViews().get(0);
            view.setStyle(RadarChartStyle.FILLED);

            // Display the Design score of the first product.
            RadarDataLabel label = new RadarDataLabel();
            label.setShowValue(true);
            RadarSeries firstSeries = (RadarSeries) chart.getSeries().get(0);
            firstSeries.getDataLabels().setLabel(2, label);

            // Save the presentation.
            Files.createDirectories(Path.of("output"));
            try (OutputStream output = Files.newOutputStream(Path.of("output", "Chart.pptx"))) {
                presentation.save(output);
            }
        }
    }
}

The following screenshot illustrates the result:

 Filled radar chart that compares two products created with the DevExpress Presentation API for Java

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

RadarSeries()

Initializes a new instance of the RadarSeries class.

Declaration

public RadarSeries()

Methods

getAxisGroup() Method

Returns the axis group that displays the series.

Declaration

public ChartAxisGroupType getAxisGroup()

Returns

Type Description
ChartAxisGroupType

The axis group.

getCustomDataPoints() Method

Returns appearance settings for individual series data points.

Declaration

public IDataPointDictionary getCustomDataPoints()

Returns

Type Description
IDataPointDictionary

A dictionary that maps zero-based data point indexes to data point settings.

Remarks

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

getDataLabels() Method

Returns data label settings for the series.

Declaration

public IRadarDataLabels getDataLabels()

Returns

Type Description
IRadarDataLabels

Data label settings.

Remarks

Refer to the following help topic for additional information: Customize Chart Data Labels — Presentation API for Java.

getDataLabelsRange() Method

Returns a reference to cells that contain text for series data labels.

Declaration

public IChartDataReference getDataLabelsRange()

Returns

Type Description
IChartDataReference

A reference to the cell range, or null if the series has no data label range.

getMarker() Method

Returns marker settings for series data points.

Declaration

public Marker getMarker()

Returns

Type Description
Marker

Marker settings.

setAxisGroup(ChartAxisGroupType value) Method

Sets the axis group that displays the series.

Declaration

public void setAxisGroup(ChartAxisGroupType value)

Parameters

Name Type Description
value ChartAxisGroupType

The axis group.

Remarks

The setAxisGroup(value) method accepts the following values:

Value Description
PRIMARY Indicates primary axes.
SECONDARY Indicates secondary axes.

If you do not call the setAxisGroup(value) method, the series uses primary axes. If you call the setAxisGroup(ChartAxisGroupType.SECONDARY) method, the chart moves the series to a separate chart view and creates secondary axes for this view.

Refer to the following help topics for additional information:

setDataLabelsRange(IChartDataReference value) Method

Sets a reference to cells that contain text for series data labels.

Declaration

public void setDataLabelsRange(IChartDataReference value)

Parameters

Name Type Description
value IChartDataReference

A reference to the cell range, or null to remove the reference.

Remarks

When you assign a cell range to a series in a chart, the API calls the setShowDataLabelRange(true) method of the object that the series getDataLabels() method returns. Each data label displays the value of the cell with the same index in the range. Call the setDataLabelsRange(null) method to remove cell values from data labels.

setMarker(Marker value) Method

Sets marker settings for series data points.

Declaration

public void setMarker(Marker value)

Parameters

Name Type Description
value Marker

Marker settings.

Remarks

A new series has a marker with the MarkerStyle.AUTO symbol and size 5. To hide markers, pass a Marker object with the MarkerStyle.NONE symbol to the setMarker(value) method.

To specify the marker of an individual data point, call the DataPoint.setMarker(value) method.