wpf-401416-controls-and-libraries-charts-suite-chart-control-provide-data-empty-points.md
This topic explains what Empty Points are, how the Chart Control processes empty points, and how to add such a point to a chart.
Empty points are points with undefined values. You can use empty points to insert gaps between series point values. The Chart displays empty points as breaks in continuous series (for example, Line or Area), and missing points or bars in discrete series (for example, Bars or Points). Empty points in the Pie, Donut, and Funnel series are skipped.
The following table contains data for the charts above:
| Date | Politics | Entertainment | Travel |
|---|---|---|---|
| 01-Jan-19 | 65 | 56 | 45 |
| 02-Jan-19 | 78 | 45 | 40 |
| 03-Jan-19 | 95 | 70 | 56 |
| 04-Jan-19 | 110 | 82 | 47 |
| 05-Jan-19 | 108 | 80 | 38 |
| 06-Jan-19 | 52 | 20 | 31 |
| 07-Jan-19 | 46 | 10 | 27 |
| 08-Jan-19 | 70 | 27 | |
| 09-Jan-19 | 86 | 42 | |
| 10-Jan-19 | 92 | 65 | |
| 11-Jan-19 | 108 | 45 | 37 |
| 12-Jan-19 | 115 | 56 | 21 |
| 13-Jan-19 | 75 | 10 | 10 |
| 14-Jan-19 | 65 | 0 | 5 |
To create an empty point, execute one of the following actions:
Set a point’s value to NaN if you use the Chart Designer to add points to a series.
Leave a value undefined if you add points in markup.
Use the SeriesPoint‘s class constructors that take only an argument as a parameter if you add points to a series in code.
Or set a data point’s numeric value to Double.NaN(or Single.NaN) in a data source. If a series point has a date-time value, use the DateTime.MinValue value. Use TimeSpan.Zero for the time-span series point values.
The Chart Control does not display series labels, tooltips, and the crosshair cursor label for empty points.
Missing points (points that do not exist for particular axis arguments) are represented as empty points if the ProcessMissingPoints (NumericAggregationScaleOptionsBase.ProcessMissingPoints, DateTimeAggregationScaleOptionsBase.ProcessMissingPoints or TimeSpanAggregationScaleOptionsBase.ProcessMissingPoints) property is set to InsertEmptyPoints.
Tip
Use a series’s EmptyPointOptions property to access empty point settings. Specify the EmptyPointOptions.ProcessPoints property to select the manner in which the chart control should handle empty points.
For example, use the following code to display points with predicted values instead of empty points.
<dxc:BarSideBySideSeries2D ...>
<dxc:BarSideBySideSeries2D.EmptyPointOptions>
<dxc:EmptyPointOptions ProcessPoints="Interpolate" Brush="#80808080"/>
</dxc:BarSideBySideSeries2D.EmptyPointOptions>
</dxc:BarSideBySideSeries2D>
Appearance settings of empty points depends on the series type. Depending on the series, set the EmptyPointOptions property value to one of the following types and configure empty point appearance settings:
The example below configures empty point appearance for line, area, and bar series. Empty points are painted gray:
<dxc:LineSeries2D DisplayName="Day Temperature" ...>
<dxc:LineSeries2D.EmptyPointOptions>
<dxc:LineEmptyPointOptions ProcessPoints="Interpolate"
Brush="#808080">
<dxc:LineEmptyPointOptions.LineStyle>
<dxc:LineStyle Thickness="1" >
<dxc:LineStyle.DashStyle>
<DashStyle Dashes="2 2"/>
</dxc:LineStyle.DashStyle>
</dxc:LineStyle>
</dxc:LineEmptyPointOptions.LineStyle>
</dxc:LineEmptyPointOptions>
</dxc:LineSeries2D.EmptyPointOptions>
</dxc:LineSeries2D>
<dxc:AreaSeries2D DisplayName="Wind" ...>
<dxc:AreaSeries2D.EmptyPointOptions>
<dxc:AreaEmptyPointOptions ProcessPoints="Interpolate"
Brush="#80808080">
<dxc:AreaEmptyPointOptions.Border>
<dxc:SeriesBorder Brush="DarkGray"/>
</dxc:AreaEmptyPointOptions.Border>
</dxc:AreaEmptyPointOptions>
</dxc:AreaSeries2D.EmptyPointOptions>
</dxc:AreaSeries2D>
<dxc:BarSideBySideSeries2D DisplayName="Pressure" ...>
<dxc:BarSideBySideSeries2D.EmptyPointOptions>
<dxc:EmptyPointOptions ProcessPoints="Interpolate"
Brush="#80808080"/>
</dxc:BarSideBySideSeries2D.EmptyPointOptions>
</dxc:BarSideBySideSeries2D>
The Chart does not draw a point between two empty points. To display a point in this case, enable the ShowIsolatedPoints (LineSeries2D.ShowIsolatedPoints or CircularLineSeries2D.ShowIsolatedPoints) property.
| ShowIsolatedPoints = true | ShowIsolatedPoints = false |
|---|---|
<dxc:ChartControl>
<dxc:XYDiagram2D>
<dxc:LineSeries2D ShowIsolatedPoints="True">
<dxc:SeriesPoint Argument="A" Value="5"/>
<dxc:SeriesPoint Argument="B" Value="6"/>
<dxc:SeriesPoint Argument="C" />
<dxc:SeriesPoint Argument="D" Value="4"/> <!-- This point is isolated. -->
<dxc:SeriesPoint Argument="E" />
<dxc:SeriesPoint Argument="F" Value="6"/>
<dxc:SeriesPoint Argument="G" Value="8"/>
<dxc:SeriesPoint Argument="H" Value="7"/>
</dxc:LineSeries2D>
</dxc:XYDiagram2D>
</dxc:ChartControl>