I need the ability to not draw a line between certain points in a line series. For example, say you had the following points:
1, 10
2, 20
3, 50
4, 30
5, 10
If the Y scale only went to 40, then there would be a break between points 2 and 4 above. In other words you would have a line connecting 1 and 2 and another line connecting 4 and 5, but nothing in between.
If I simply delete point 3, I end up with a line from 2 to 4 which isn't what I'm looking for.
Thank you.
Hi,
Try setting the value of that point to double.NaN, and if the series type you are using has the UnknownValuePlotting property set it to DontPlot.
Hope this helps!
-Graham
I have a scenario where I need to be able to support both gaps and interpolation in the same series. Ideally, I would like to use 'null' to indicate that the the series should 'DontPlot' and 'double.NaN' to indicate that the series should 'Interpolate'
This is VERY important to our app. Can you tell me how to do this or if there is a work around you can think of?
I like the idea - we didn't consider this approach because all of our series (plural) are in the same IEnumeralbe<T>
But your suggestion made me think - we could create a CollectionViewSource, set its source to the IEnumerable<T>, and set its filter so that it removes the points from the view that are double.NaN, but just for the appropriate series.
Each series can have its own CollectionViewSource and its own independent filter...
Thanks for the help :)
-Mike
The chart doesn't currently support both of these methods simultaneously. You could make a feature request to this effect though.
My other recommendation is to set the series on Don't Plot, and use the null values to indicate this, but then remove the Double.NaN values, which should be interpolated, from the sequence before assigning it to the ItemsSource. You can remove them either by just subtracting them from the sequence, unless its important to show a data value at that index, or substituting them with a linear interpolated value between the previous and the next point.
In this way you can support both the discontinuities in the line, and the interpolated sections.