I need the ability to not draw a line between certain points in a line series. For example, say you had the following points:
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.
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!
That worked! Thanks for the super fast response. We just bought the control so don't know it all that well. So far I'm very happy with the support!
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?
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.
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 :)
This helps. But sometimes after zooming and scrolling I get this snark.
At the beginning:
After zooming and scrolling (a snark):
How can I avoid this?
Your images aren't showing and I'm uncertain what you mean by snark. Could you clarify? Is there a way you can provide a sample project that reproduces the issue?
I loaded these images!
Sometimes after zooming and scrolling I get this snark.
Truly yours Mikhail
I am unable to see your images. Could you try sharing them again?