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

Coupling GanttView with TImeBar

8 Answers 93 Views
GanttView
This is a migrated thread and some comments may be shown as answers.
Eric
Top achievements
Rank 1
Eric asked on 14 Jun 2012, 08:23 PM
Hi,

Is there a good way to couple the TimeBar with GanttView, so that the selection of a timebar selection modifies whats shown on the gantt chart?

Thanks,

Eric

8 Answers, 1 is accepted

Sort by
0
Konstantina
Telerik team
answered on 15 Jun 2012, 02:43 PM
Hi Eric,

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,

Konstantina
the Telerik team

 

Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>
0
Eric
Top achievements
Rank 1
answered on 19 Jun 2012, 01:43 AM
Hello,

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>
0
Konstantina
Telerik team
answered on 20 Jun 2012, 03:03 PM
Hi Eric,

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.

All the best,
Konstantina
the Telerik team
Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>
0
Eric
Top achievements
Rank 1
answered on 22 Jun 2012, 01:21 AM

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>

0
Mike
Top achievements
Rank 1
answered on 22 Jun 2012, 07:07 PM
So I figured out that the reason It would not zoom in further was the lack of interval spans.  That and the data range just being too big (which was described here: http://www.telerik.com/community/forums/silverlight/general-discussions/timebar-and-hours.aspx).  My next question is: Is there a way to control the rate at which I can zoom?  Currently, and in your demos, it takes many scrolls of the mouse wheel to zoom in just a little bit.  I realize that the bottom bar works well enough, but I would like to be able to zoom effectively with the mouse wheel.
Thanks,

Eric
0
Tsvetie
Telerik team
answered on 26 Jun 2012, 10:27 AM
Hi 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

Kind regards,
Tsvetie
the Telerik team

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

0
Eric
Top achievements
Rank 1
answered on 26 Jun 2012, 05:53 PM
The actual value of the visible period I don't think has a lot to do with this problem, it is instead the transitions between visible periods.  When you get to the point where it decides to use second intervals, then the scroll rate gets cut by about 60.  It would be nice if there was a more gradual trasition (ie, 60,50,40...5,4,3,2,1)

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
0
Tsvetie
Telerik team
answered on 02 Jul 2012, 08:32 AM
Hi 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.

Greetings,
Tsvetie
the Telerik team

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

Tags
GanttView
Asked by
Eric
Top achievements
Rank 1
Answers by
Konstantina
Telerik team
Eric
Top achievements
Rank 1
Mike
Top achievements
Rank 1
Tsvetie
Telerik team
Share this question
or