New to Telerik UI for WinForms? Download free 30-day trial

Null Values Support

RadChartView supports empty values in the series. In general empty values means missing Y value for a particular X value.

Data Containing Null


barSeries.ShowLabels = true;
barSeries.PointSize = new SizeF(15, 15);
barSeries.DataPoints.Add(new CategoricalDataPoint(10));
barSeries.DataPoints.Add(new CategoricalDataPoint(5));
barSeries.DataPoints.Add(new CategoricalDataPoint(40));
barSeries.DataPoints.Add(new CategoricalDataPoint(null));
barSeries.DataPoints.Add(new CategoricalDataPoint(11));
barSeries.DataPoints.Add(new CategoricalDataPoint(20));
radChartView1.Series.Add(barSeries);

barSeries.ShowLabels = True
barSeries.PointSize = New SizeF(15, 15)
barSeries.DataPoints.Add(New CategoricalDataPoint(10))
barSeries.DataPoints.Add(New CategoricalDataPoint(5))
barSeries.DataPoints.Add(New CategoricalDataPoint(40))
barSeries.DataPoints.Add(New CategoricalDataPoint(New Nullable(Of Double)()))
barSeries.DataPoints.Add(New CategoricalDataPoint(11))
barSeries.DataPoints.Add(New CategoricalDataPoint(20))
radChartView1.Series.Add(barSeries)

Figure 1: BarSeries With Null DataPoint

WinForms RadChartView BarSeries With Null DataPoint

The empty X value is skipped from drawing. NullValues is supported only for Cartesian series like Bar, Line, Spline, Area and SplineArea.

Empty values for financial series is unsupported scenario. OHLC and Candlestick series always know their Open, Close, High and Low values, so there is no valid scenario with empty values for this type of visualization. Empty values for pie chart are unsupported as well. Pie slices should always make up to 360 degrees when combined.

In VB.NET one should be careful when using the nullable value types. Unless the object is not explicitly set as nullable its value will be implicitly cast to the default value for the data type.

See Also

In this article