How to chart collection of line segments or multipart polylines

Charts for WPF Forum

Posted 11 years ago by Erez Anzel
Version: 14.1.0600
Avatar

I successfully chart a LineSeries and AreaSeries, providing data by binding to a ReadOnlyObservableCollection of Tuple<double, double>, meaning that I give a list of XY point pairs. And your code dutifully draws a line from the first point to the second, from the second to the third, etc.

But I'd like to be able to draw an unknown number of two-vertex line segments in one LineSeries or some such series. For instance, perhaps I could provide a collection of Tuple<double, double, double, double>, where each element contained the XY values of the "from" vertex and the XY values of the "to" vertex.

A more complex case, which I also need, is to draw a multipart polyline. By "polyline" I mean a line consisting of two or more vertices, where each vertex is a pair of XY values. By "multipart" I mean that it can be discontinuous: If the vertices in the collection are points A, B, C, ..., H, for instance, then I might want a line to be drawn from A to B, then another one from C to D to E to F, and another one from G to H. That means that there would be a gap from B to C, and from F to G. Obviously I would need to provide some indication of where these breaks should be, or provide this collection in the same manner as the collection of two-vertex line segments, which would mean duplicating almost every vertex.

Is this possible? If so, since which version of Charts? If not, what would you suggest as a workaround, and when might it be possible without a workaround?

Thanks for any guidance you can provide.

Comments (3)

Posted 11 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar

Hi Erez,

Unfortunately we don't really have a mechanism for doing that sort of thing.  Your best bet, at least for the line segments, would be to possibly have each sequential set of segments be in a series.  Then after a gap, make a new series for the next sequential set, and so on.  Perhaps you could do something similar to achieve the polyline.


Actipro Software Support

Posted 10 years ago by Samuel Keating
Avatar

I don't posses much information about it but one of my friend also does a chart library work who can help you out. So you can contact him and get your work done.

[Modified 10 years ago]

Posted 10 years ago by Erez Anzel
Avatar

Thanks, Samuel. I followed the link. I am still hoping that Actipro will implement what I need, as I want to have all of my charting handled with one product...Erez

The latest build of this product (v24.1.3) was released 1 month ago, which was after the last post in this thread.

Add Comment

Please log in to a validated account to post comments.