Skip to main content

RadarChartView Class

Contains settings that apply to radar series in a chart view.

Declaration

public class RadarChartView extends ColorfulChartView

Remarks

When you add a RadarSeries object to a chart, the chart creates a RadarChartView object for the series. Call the Chart.getViews() method to access chart views.

Call the setStyle(RadarChartStyle value) method to specify the radar chart style.

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

See Also

RadarChartView()

Initializes a new instance of the RadarChartView class.

Declaration

public RadarChartView()

Methods

getChartType() Method

Returns the chart type of the view.

Declaration

public ChartType getChartType()

Returns

Type Description
ChartType

ChartType.RADAR.

getStyle() Method

Returns the radar chart style.

Declaration

public RadarChartStyle getStyle()

Returns

Type Description
RadarChartStyle

The radar chart style.

setStyle(RadarChartStyle value) Method

Sets the radar chart style.

Declaration

public void setStyle(RadarChartStyle value)

Parameters

Name Type Description
value RadarChartStyle

The radar chart style.

Exceptions

Type Description
NullPointerException

Thrown if the value parameter is null and the chart view is in a presentation.

Remarks

The setStyle(value) method accepts the following values:

Value Description
MARKER Indicates that the radar chart displays series as lines with markers.
FILLED Indicates that the radar chart displays series as filled areas.

If you do not call the setStyle(value) method, the API uses RadarChartStyle.MARKER.