8 Answers, 1 is accepted
I have created a very simple example how you could bind the selected range of the TimeBar to the VisibleRange of the GanttView. Please find the project attached.
Please let us know if you have further questions about our controls.
Regards,
the Telerik team
Thanks for the example. How did you manage to get the timebar to zoom in with the center mouse button? I created a time bar with the code below, but it doesn't zoom.... Also, is there a "zoom" event which would allow me to change the selection when the zoom is changed? Essensially, I want the selection box to stay the same size as you zoom in/out, so that's equivelint to changing the selection start/end as you zoom in/out. Here is my timebar code:
Eric
<
telerik:RadTimeBar
Grid.Row
=
"2"
x:Name
=
"radTimeBar"
MinZoomRange
=
"31.00:00:00"
>
<
telerik:RadChart
x:Name
=
"timeBarChart"
>
<
telerik:RadChart.DefaultView
>
<
telerik:ChartDefaultView
>
<
telerik:ChartDefaultView.ChartArea
>
<
telerik:ChartArea
>
<
telerik:ChartArea.AxisX
>
<
telerik:AxisX
Visibility
=
"Collapsed"
/>
</
telerik:ChartArea.AxisX
>
</
telerik:ChartArea
>
</
telerik:ChartDefaultView.ChartArea
>
<
telerik:ChartDefaultView.ChartLegend
>
<
telerik:ChartLegend
Visibility
=
"Collapsed"
/>
</
telerik:ChartDefaultView.ChartLegend
>
<
telerik:ChartDefaultView.ChartTitle
>
<
telerik:ChartTitle
Visibility
=
"Collapsed"
/>
</
telerik:ChartDefaultView.ChartTitle
>
</
telerik:ChartDefaultView
>
</
telerik:RadChart.DefaultView
>
</
telerik:RadChart
>
</
telerik:RadTimeBar
>
In order to be able to zoom in/out and actually see the items of the current interval, you should specify the period that the timeBar control visualizes using the PeriodStart and PeriodEnd properties.
Regarding your second question - about the zoom event, no, RadTimeBar has no zoom event. However you can use the VisiblePeriodStart and VisiblePeriodEnd properties to achieve this result. For example, in case you bind to these properties using two-way binding (MVVM pattern), you can update the selection of the control when their values change.
Konstantina
the Telerik team
Hello,
So after expirimenting a little bit, it looks like the timebar will not zoom in past 1 hour granularity. As the data I am trying to view spans about an hour and goes down to the second level, there is an issue. Do you know a resolution for this?
Here is my new timebar code:
Thanks,
Eric
<
telerik:RadTimeBar
Grid.Row
=
"2"
x:Name
=
"radTimeBar"
Background
=
"Transparent"
PeriodStart
=
"1/1/2012 12:00:00 AM"
PeriodEnd
=
"12/31/2012 11:59:59 PM"
SelectionStart
=
"{Binding SelectionStart, Mode=TwoWay}"
SelectionEnd
=
"{Binding SelectionEnd, Mode=TwoWay}"
>
<
telerik:RadTimeBar.Intervals
>
<
telerik:MonthInterval
/>
<
telerik:WeekInterval
/>
<
telerik:DayInterval
/>
<
telerik:HourInterval
/>
<
telerik:MinuteInterval
/>
<
telerik:SecondInterval
/>
<
telerik:MillisecondInterval
/>
</
telerik:RadTimeBar.Intervals
>
<
telerik:RadChart
x:Name
=
"timeBarChart"
>
<
telerik:RadChart.DefaultView
>
<
telerik:ChartDefaultView
>
<
telerik:ChartDefaultView.ChartArea
>
<
telerik:ChartArea
>
<
telerik:ChartArea.AxisX
>
<
telerik:AxisX
Visibility
=
"Collapsed"
/>
</
telerik:ChartArea.AxisX
>
</
telerik:ChartArea
>
</
telerik:ChartDefaultView.ChartArea
>
<
telerik:ChartDefaultView.ChartLegend
>
<
telerik:ChartLegend
Visibility
=
"Collapsed"
/>
</
telerik:ChartDefaultView.ChartLegend
>
</
telerik:ChartDefaultView
>
</
telerik:RadChart.DefaultView
>
</
telerik:RadChart
>
</
telerik:RadTimeBar
>
Thanks,
Eric
The rate at which you zoom in using the mouse wheel depends on the currently displayed interval type. That is, with the mouse wheel, you zoom in by one or a couple of unit(s) of the current interval. In case one unit is represented by 10 pixels on the time-line, the visible slot will change by about 10 pixels.
In this case, I would recommend that you specify a smaller initial visible period using the VisiblePeriodStart and VisiblePeriodEnd properties of the timeBar control. Have a look at this online demo for a reference.
Tsvetie
the Telerik team
Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>
It looks like there may be two solutions to this, but I'm not sure how to do either. First, the time bar could be said to switch between "minute" and "second" intervals much too soon, so that there are too many second intervals displayed at once, at the scroll rate starts to crawl. Otherwise, I wonder if the second interval be displayed, but the minute interval used for scrolling. Finally, if none are these are possible, is it feasable to override the zoom functionality myself?
Thanks,
Eric
In short, none of the two approaches are available with RadTimebar out of the box. I could suggest that you use the IntervalSpans property - it is demonstrates in our Small Intervals demo. You can read about this property in our online documentation as well.
In case this approach does not meet your requirements, you can indeed download the source code and make custom modifications. Please note, however, that we do not support custom modifications of the source code.
Tsvetie
the Telerik team
Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>