RadarChartStyle Enum
Lists radar chart styles.
Declaration
public enum RadarChartStyle extends Enum<RadarChartStyle> implements IIntEnum
Members
| Name | Description |
|---|---|
FILLED
|
Indicates that the radar chart displays series as filled areas. |
MARKER
|
Indicates that the radar chart displays series as lines with markers. |
fromValue(int value)
|
Returns the |
getName()
|
Returns the name of the |
getValue()
|
Returns the integer value of the |
toString()
|
Returns the string representation of the |
valueOf(String name)
|
Returns the |
values()
|
Returns an array of all |
Remarks
Call the RadarChartView.getStyle() method to get the style of a radar chart. Call the RadarChartView.setStyle(value) method to specify the 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:
