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.
|
SPAN
|
Connects data points on both sides of a blank value with a line.
|
ZERO
|
Displays blank values as zeros.
|
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 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);
}
}
}
}


