Empty Data

2 posts, 1 answers
  1. Jerome
    Jerome avatar
    87 posts
    Member since:
    Aug 2010

    Posted 04 Nov 2012 Link to this post

    I am trying to put a RadSparkline into a TimeBar, where the TimeBar is animated to advance over a window of time from 4 hours ago to now. Basically, it should show a moving spark line that corresponds with the last 4 hours. Call center stuff.

    I've got the TimeBar moving just fine by binding it's Period values to a VM value that updates once per second. It looks lovely.

    The problem I'm having is that when the window is initially opened, there is no data for the last 4 hours. The best I can do is plug in data from now going forwards. I'd like to do this, and have it appear as if the Sparkline is moving in from the right side of the screen, as time advances.

    But the Sparkline's contents of course only include the data that has been put into the Sparkline, and it seems to have no provision to alter it's constraints without data. For instance, I want the Sparkline to size itself as if to show values between 4 hours ago and now. Even though I only have values for the last few minutes.

    Is there any decent way to accomplish this?


    I've thought of a decent way to do it. Write my own ContentControl which is aware of the TimeBar's PeriodStart and PeriodEnd, as well as the Sparkline data, and does it's own layout. Then put the sparkline in that. And put that in the TimeBar. But that takes work. Any other way?
  2. Answer
    Tsvetie avatar
    1517 posts

    Posted 07 Nov 2012 Link to this post

    Hi Jerome,

    RadSparkline indeed supports this scenario. Basically, you need to set its AutoRange property to "false" and specify the correct x-range using the MinXValue and MaxXValue properties of the sparkline - you need to set them to the PeriodStart and PeriodEnd timeBar values in ticks in this case.

    the Telerik team

    Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

Back to Top