This is a migrated thread and some comments may be shown as answers.

Empty Data

1 Answer 68 Views
Sparkline
This is a migrated thread and some comments may be shown as answers.
Jerome
Top achievements
Rank 1
Jerome asked on 04 Nov 2012, 02:50 PM
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?

[EDIT]

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?

1 Answer, 1 is accepted

Sort by
0
Accepted
Tsvetie
Telerik team
answered on 07 Nov 2012, 01:31 PM
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.

Greetings,
Tsvetie
the Telerik team

Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

Tags
Sparkline
Asked by
Jerome
Top achievements
Rank 1
Answers by
Tsvetie
Telerik team
Share this question
or