Under review

Discontinuous LineSeries

Oystein Bjorke 4 years ago • updated by bsguedes 4 years ago 7
This discussion was imported from CodePlex

torbonde wrote at 2014-06-11 09:21:

At the moment I'm using a LineSeries, to view my data. But sometimes there might be missing datapoints, which I would like to be made aware of. I was thinking that what I want is something like LineSeries, but allowing discontinuities. For instance, such that I can specify a number (or a timespan in my case), and when two consecutive datapoints are further apart than that, no line would be drawn between them. I assume that this is not already a part of OxyPlot, but is it possible for me to implement? I have no idea where to start.

objo wrote at 2014-06-11 12:10:

Try to add a DataPoint.Undefined or set one of the coordinates to NaN. This should create a break in the line. Also see the BrokenLineStyle and BrokenLineColor properties if you want to show a line where the break is.

torbonde wrote at 2014-06-11 12:22:

Yeah, I thought of that. But there is no way to achieve this without adding a lot of NaNs? Like writing a new Series-class?
I'd like to have a similar behavior with an AreaSeries; however, none of the two possibilities (DataPoint.Undefined and NaN) are working for me.

I'm trying to achieve something like this: http://i.imgur.com/yRBXzSn.png

Under review
Yes, "Discontinuous AreaSeries" could be added as a new issue at GitHub. I see some possible problems if the first and second point collection are not in sync, but we could set the limitation that these two collection should be in sync. The AreaSeries could also be refactored to only support one collection (e.g. of AreaSeriesItem, where each item contains two points).
Thanks for the answer! I agree that points should be in sync, so I think that the best idea is to create something like an AreaSeriesItem like you have suggested. If I can be of any help implementing it please let me know!

Best Regards,
Yes, please contribute:
  1. add issue at github
  2. fork
  3. branch and do the coding
  4. create pull request!
I think assuming the two collections are in sync is ok for the first iteration. Then the AreaSeries could be refactored in the next step.
All right. I created the issue #215 and will track progress on this task there! Thanks again!
I can't manage to build the code I just cloned... I have VS2012 with .NET 4.5 and the solution does not build, returning lots of missing namespace references... any idea on this, anyone?