Skip to main content

DisplayBlanksAsType Enum

Lists display modes for blank values in a chart.

Declaration

public enum DisplayBlanksAsType extends Enum<DisplayBlanksAsType> implements IIntEnum

Members

Name Description
GAP

Displays blank values as gaps.

DevExpress Office & PDF File API for Java - Display Blanks as Gap

SPAN

Connects data points on both sides of a blank value with a line.

DevExpress Office & PDF File API for Java - Display Blanks as Span

ZERO

Displays blank values as zeros.

DevExpress Office & PDF File API for Java - Display Blanks as Zero

fromValue(int value)

Returns the DisplayBlanksAsType enumeration constant with the specified integer value.

getName()

Returns the name of the DisplayBlanksAsType enumeration constant.

getValue()

Returns the integer value of the DisplayBlanksAsType enumeration constant.

toString()

Returns the string representation of the DisplayBlanksAsType enumeration constant.

valueOf(String name)

Returns the DisplayBlanksAsType enumeration constant with the specified name.

values()

Returns an array of all DisplayBlanksAsType enumeration constants.

Remarks

Call the ChartOptions.getDisplayBlanksAs() method to get the display mode for blank values. Call the ChartOptions.setDisplayBlanksAs(value) method to specify the display mode.

Example

Display Blank Values as Gaps in a Line Chart

The following code snippet creates a line chart with a blank value, displays the blank value as a gap, and applies rounded chart corners:

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

            // Populate monthly values and leave the July value blank.
            ChartData data = chart.getData();
            double[] values = { 23, 20, 17, 14, 9, 3, Double.NaN, 4, 11, 10, 13, 17 };
            for (int i = 0; i < values.length; i++) {
                data.get("B" + (i + 1)).setDateTimeValue(
                        LocalDate.of(2025, i + 1, 1).atStartOfDay(ZoneOffset.UTC).toInstant());
                if (!Double.isNaN(values[i]))
                    data.get("A" + (i + 1)).setNumericValue(values[i]);
            }

            // Bind a line series to the chart data.
            LineSeries series = new LineSeries();
            series.setArguments(new ChartDataReference("B1", "B12"));
            series.setValues(new ChartDataReference("A1", "A12"));
            chart.getSeries().add(series);

            // Display the blank value as a gap and round chart corners.
            chart.getOptions().setDisplayBlanksAs(DisplayBlanksAsType.GAP);
            chart.getOptions().setRoundedCorners(true);

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

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
DisplayBlanksAsType