RadChart for Silverlight/WPF Empty Values support

by XAML Team | Comments 7

The Q1 2011 version of the Chart control will include code to support empty/null values. There are many scenarios, in which the property of an object, or a collection of objects, to which the Chart is data bound, is null. The following code example demonstrates one such case:

clip_image002

The null values above are hard-coded, however they convey the general idea of null values being returned by the data layer, to which the Chart is data bound.

Internally, there are three ways in which these null values can be handled. This is specified by a property in the control, for the series definition, named EmptyPointBehavior. This is a dependency property, which is defined per Series Definition. It has three options:
1. Zero.This property is the default property of each series. When this option is used, each null value is replaced with a zero. The data entry is not removed from the data collection. Only its original null/empty value is replaced with zero. This behavior is demonstrated in the screenshot below, where the data points at positions 3 and 4 had originally been empty(null), and internally replaced by 0 :
clip_image004

2. Gap. This option visually removes the regions for each set of empty(null) points. The data entry is not removed from the data collection. Essentially, it connects the points neighboring the null point (or the collection of empty values). Again, assuming that the data points at positions 3 and 4 have null values, the rendered chart will look like this:

clip_image006

3. Drop - this option clips, or visually removes each section/segment, corresponding to a set of empty points/values. A Chart rendered using this option would look like this:

clip_image008

We will be happy to know what you think about it!


Team Lead,
XAML DataViz Team

7 Comments

Yipi
This is a good thing. Using zeroes as default doesn't really make sense in most business charts end-users request but I guess you have your reasons. Do you know if the RadLinearSparkLine will be modified so the sparkline's DropPoint and the chart's Drop mean the same thing (DropPoint seems to be the Gap option you talk about above).
Andre Carlucci
Amazing, can't wait for this feature.
Brendan
Yes the drop feature is a very high priority for us
Travis Haberman
If we use a drop or gap, what happens to the autoscale of the y-axis?  We are using this feature now, but even through the values are droped or gapped, the autoscale of the y-axis still extends down to ZERO.  It's as if the value of ZERO is still considered for these gap points when the autoscale is calculated.  Please advise
Ves
Travis, this is a bug. The empty values should not force the axis to extend to zero. The fix will be included in the next LIB, expected on Monday. Thanks for pointing this.
Amit
Please answer Yipi's questions because I too want the Drop behavior in RadLinearSparkline but the available DropPoint seems to work as Gap option.
Neil
They have drop and gap the wrong way round above.
Use "Gap" for a gap in the lines.

Comments

  1.    
      
      
       
  2. (optional, emails won't be shown on public pages)
  3. (optional)
Read more articles by XAML Team - or - read latest articles in Developer Tools