Skip to main content
Home Forums Silverlight Programming Silverlight Controls and Silverlight Toolkit Inserting lineseries dynamically?
2 replies. Latest Post by wundarous on August 5, 2009.
(0)
weeser
Member
133 points
97 Posts
07-02-2009 11:11 AM |
Hi!
I have a chart that has 6 line series on it, 5 of them are lines representing limits of the graph and one is the actual data. The issue is, the limits may change, and the old and new limits are stored in the database according to date. The user can selected a range of dates to view the graph in, but in the case the user selects a range of dates where the limits change is a problem. We want to keep the limits as horizontal lines. So i was wandering a way to handle a limit change.
All of the lineseries get data through binding, but is there a way to line jump?....or go from one line to the next without drawing in the gap? My thought was inserting new line series dynamically based on how many limit changes there are, but that will take up a lot of resources and time to insert and remove those lineseries. Any ideas would be wonderfull !
Thanks in advance,
Josh
David Anson
Participant
1718 points
212 Posts
07-15-2009 4:30 PM |
Josh,
Your idea seems good to me as well. One day we may support "missing data" which you could use to create a line break here - but we don't today and I don't see a good way of telling LineSeries to obscure parts of itself but not others.
One alternative approach would be to NOT use LineSeries for the 5 boundary markers and instead to draw those lines yourself via the Axis APIs. I'm thinking something along the lines of this example: http://leeontech.wordpress.com/2009/02/25/linechart-with-markers/. This should be pretty efficient, I'd think.
Hope this helps!
wundarous
2 points
9 Posts
08-05-2009 2:07 PM |
How about specifying an interpolation method, which would draw data that is missing as a straight line (i.e. the previous point).
For example, let's say I'm plotting time and values:
January 1,000
April 1,200
Right now the lineseries interpolates from 1,000 to 1,200, and it looks like a diagonal line of growth from January to April. One solution would be to draw the line as 1,000 straight until April, where it jumps to 1,200. It might also be misleading, but it's useful in some cases, whereas the behavior now is not.