Search code examples
silverlightsilverlight-4.0silverlight-toolkit

Connect Silverlight Line Series Points Based On Dependent Value


Here's my current chart:

enter image description here

Is it possible to get the green and red series to connect points based on the dependent value (TVD) and not the independent value (Pressure)?

I'd like to connect the points based on the increase in TVD.

My series are bound to values found in a list of objects. The list of objects is sorted based on the increase in TVD, but when I bind my list to the series, the points connect based on increase in pressure.


Solution

  • I would hazard a guess that it isn't possible.

    I was able to reproduce the chart sorting the points in X order. Indeed, it seems the LineSeries class (or rather its superclass, LineAreaSeriesBase, source), keeps the points in a collection ordered by independent value. So, the LineSeries will completely ignore the order in which you supply the points.

    The next thing I tried was swapping the X and Y axes. I tried a few things that I thought would work but in the end all I got was an 'Assigned independent axis cannot be used' exception. Google turned up this post on the MSDN forums about a year ago, in which another user asks the same question and gets no helpful answers.

    If you really want a chart plotting points in order of TVD, then I would have to recommend abandoning the Silverlight Toolkit chart and using a third-party control instead. Every time I've attempted to use the Silverlight Toolkit chart I've run up against an issue or an inflexibility with it. In my opinion it's just not good enough for production use. You're evidently working for the oil industry, so it's not like they can't afford a few hundred dollars for a licence for one of these libraries.