Skip to main content

QuartileCalculationMode Enum

Lists quartile calculation methods for box and whisker series.

Declaration

public enum QuartileCalculationMode extends Enum<QuartileCalculationMode> implements IIntEnum

Members

Name Description
EXCLUSIVE

Indicates that the quartile calculation excludes the median from both halves of the data set.

INCLUSIVE

Indicates that the quartile calculation includes the median in both halves of the data set.

fromValue(int value)

Returns the QuartileCalculationMode enumeration constant with the specified integer value.

getName()

Returns the name of the QuartileCalculationMode enumeration constant.

getValue()

Returns the integer value of the QuartileCalculationMode enumeration constant.

toString()

Returns the string representation of the QuartileCalculationMode enumeration constant.

valueOf(String name)

Returns the QuartileCalculationMode enumeration constant with the specified name.

values()

Returns an array of all QuartileCalculationMode enumeration constants.

Remarks

Call the BoxAndWhiskerSeries.getQuartileCalculationMode() method to get the quartile calculation method of a box and whisker series. Call the BoxAndWhiskerSeries.setQuartileCalculationMode(value) method to specify the 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 Box and Whisker Chart

The following code snippet creates a box and whisker chart with two series and two categories, displays mean markers, mean lines, and outliers, and applies the exclusive quartile calculation method:

import java.io.*;
import java.nio.file.*;
import java.util.*;
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);

            // Each value belongs to the category with the same index (five Math scores, then five Science scores).
            List<String> subjects = new ArrayList<>(Collections.nCopies(5, "Math"));
            subjects.addAll(Collections.nCopies(5, "Science"));

            // Add a box and whisker series for each team.
            String[] teams = { "Team A", "Team B" };
            List<List<Double>> scores = List.of(
                    List.of(62.0, 70.0, 74.0, 80.0, 98.0, 58.0, 66.0, 71.0, 75.0, 82.0),
                    List.of(55.0, 64.0, 69.0, 73.0, 79.0, 61.0, 68.0, 72.0, 77.0, 85.0));
            for (int i = 0; i < teams.length; i++) {
                BoxAndWhiskerSeries series = new BoxAndWhiskerSeries();
                series.setText(teams[i]);
                series.setArguments(new ChartStringData(subjects));
                series.setValues(new ChartNumericData(scores.get(i)));

                // Display mean markers, mean lines, and outliers, and specify the quartile calculation method.
                series.setShowMeanMarkers(true);
                series.setShowMeanLine(true);
                series.setShowOutlierPoints(true);
                series.setQuartileCalculationMode(QuartileCalculationMode.EXCLUSIVE);
                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);
            }
        }
    }
}

The following screenshot illustrates the result:

 Box and whisker chart with two series, mean markers, and mean lines created with the DevExpress Presentation API for Java

Implements

com.devexpress.java.enums.IIntEnum

Inherited Members

java.lang.Enum.<T>valueOf(java.lang.Class<T>,java.lang.String)
java.lang.Enum.clone()
java.lang.Enum.compareTo(E)
java.lang.Enum.describeConstable()
java.lang.Enum.equals(java.lang.Object)
java.lang.Enum.finalize()
java.lang.Enum.getDeclaringClass()
java.lang.Enum.hashCode()
java.lang.Enum.name()
java.lang.Enum.ordinal()
java.lang.Enum.toString()
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
java.lang.Enum
QuartileCalculationMode