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

How to control zoom level depending on data

3 Answers 108 Views
TimeLine
This is a migrated thread and some comments may be shown as answers.
Robert
Top achievements
Rank 1
Robert asked on 11 Jul 2012, 07:13 PM
I'm currently using the mvvm pattern along with the Timeline to display time based information.
I can't seem to find a good way of displaying the varying sets of data with a preset zoom level.

Sometimes, the dataset will contain values that are within seconds of one another. In this case, I would want to zoom level to show 6 gaps of 10 seconds. Other times, my dataset may have values that are minutes within one another or hours within one another. I would want the zoom level to be lower so that I can see all of the data at the first glance.

Using the mvvm pattern, I set RadTimeline.Intervals once in the XAML but they don't necessarily suit my needs for all the varying sets of data.

For example, say my Intervals are:
<telerik:MinuteInterval/>
<telerik:SecondInterval/>

I then set the Start and End periods to be that of the first and last data point.


Is it possible to change the Interval time depending on the data that is being displayed?

3 Answers, 1 is accepted

Sort by
0
Robert
Top achievements
Rank 1
answered on 11 Jul 2012, 07:15 PM
I suppose a workaround would be to have several Timeline widgets. Each one would have a different interval set. Depending on my data, I will "show" the Timeline with the the proper display and "hide' the other ones.
0
Accepted
Tsvetie
Telerik team
answered on 12 Jul 2012, 10:48 AM
Hi Robert,

You can bind the PeriodStart and PeriodEnd properties of the timeline to properties of your view model. You can do this for the VisiblePeriodStart and VisiblePeriodEnd properties as well - they specify the current visible range in the timeline control and thus, the zoom level.

Regarding the intervals collection - you can add all interval types that you might need to the intervals collection - the timeline control will determine the best view, depending on the current visible range and the whole range. Thus, the additional interval types in the intervals collection will not be a problem.

Kind regards,
Tsvetie
the Telerik team

Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>

0
Robert
Top achievements
Rank 1
answered on 12 Jul 2012, 02:42 PM
Hello Tsvetie,

I've been able to use the IntervalSpans to get the result I'm looking for.

Thanks!
Tags
TimeLine
Asked by
Robert
Top achievements
Rank 1
Answers by
Robert
Top achievements
Rank 1
Tsvetie
Telerik team
Share this question
or