Zoom in/out causes long delays on timebar

4 posts, 0 answers
  1. EM
    EM avatar
    21 posts
    Member since:
    Oct 2006

    Posted 29 Apr 2011 Link to this post

    Hello,

    I'm not sure if anyone has the issue I'm experiencing:  Timebar (Q1 2011 SP1) works flawlessly so long as the control isn't asked to  zoom in or out using either the mouse wheel or resize the scrollbar.   The control eventually updates but it can take upwards of 30 seconds on a data set of 10 or 100 points - doesn't matter.

    The code is based on the blog example that has the timebar updating a chart object so that when the user interacts with the timebar, the selected window updates the main chart.

    <Grid x:Name="gridTimebar" Grid.ColumnSpan="2" Grid.Row="1" >
        <telerik:RadTimeBar x:Name="timeBar" PeriodStart="1-Jan-2010 12:00:00 AM" PeriodEnd="31-Dec-2011 11:59:59 PM"
             VisiblePeriodStart="11-Nov-2010 12:00:00 AM" VisiblePeriodEnd="14-March-2011 11:59:59 PM"
             SelectionStart="1-Jan-2011 12:00:00 AM" SelectionEnd="28-Feb-2011 11:59:59 PM"
             SelectionChanged="OnTimebarSelectionChanged">
            <telerik:RadTimeBar.Intervals>
                <telerik:YearInterval />
                <telerik:MonthInterval />
                <telerik:DayInterval />
            </telerik:RadTimeBar.Intervals>
     
            <telerik:RadLinearSparkline x:Name="sparkLineDaily"  XValuePath="RegistrationDate" YValuePath="RegistrationCountDailyTotal" />
        </telerik:RadTimeBar>
    </Grid>

    The timebar is associated with a radChart as follows:

    <telerik:RadChart x:Name="xRadChart" UseDefaultLayout="False" TimeBar="{Binding ElementName=timeBar}"
                Grid.RowSpan="2"
                  Grid.Row="2">
     
          ... removed for brevity ...
     
    </telerik:RadChart>


    I have in code behind a function that gets the data an sets the itemsource after a silverlight RIA call:

    public void Load(int month, int year, string termList)
         {
     
         
            var context = new DataWarehouseDomainContext();
             var loadOp =
                 context.Load(context.GetRegistrationCountsQuery(Global.Context, month, year, termList));
             loadOp.Completed += (a, b) =>
                                     {
                                         if (!loadOp.HasError)
                                         {
     
     
     
     
                                             var data = new RegistrationSeries();
     
     
                                             // build our own data
                                             data.AddRange(loadOp.Entities.Select(item => new RegistrationDataPoint()
                                                                                              {
                                                                                                  ...
                                                                                              }));
     
     
     
                                             var minDate = data.Min(c => c.RegistrationDate);
                                             var maxDate = data.Max(c => c.RegistrationDate);
                                             timeBar.PeriodStart = minDate;
                                             timeBar.PeriodEnd = maxDate;
                                             sparkLineDaily.ItemsSource = data;
     
                                         }
                                     };
     
         }
           

    The binding works fine, the sparkline shows the data, the chart shows the data, the time bar can be interacted with just fine and so long as the zoom is not touched.  When a zoom is called, the timebar takes forever to update - it eventually does it, but this is very odd.

    This happens with a dataset of 10 or 100 rows, so it's doesn't seem to be a dataset size issue as far as response time goes. There is only one row of data per day.

    Cheers,


    Etienne
                        
  2. Yavor
    Admin
    Yavor avatar
    401 posts

    Posted 02 May 2011 Link to this post

    Hello EM,

    From the code that you shared everything seems normal. Perhaps the problematic code is somewhere else in your project. You can try commenting out all other controls except for the RadTimeBar and test if this slowdown appears again. Can you please share a runnable project that reproduces this issue?

    Regards,
    Yavor Ivanov
    the Telerik team
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
  3. DevCraft banner
  4. EM
    EM avatar
    21 posts
    Member since:
    Oct 2006

    Posted 02 May 2011 Link to this post

    Hello,
    back with a status update.  I ended up trying various things and finally arrived to a working solution by binding directly from XAML rather than code behind, and also binding the PeriodStart and PeriodEnd values to the data context.  This fixed the zoom delay problem altogether although I'm a bit puzzled as to why.   Here's the new working declaration.


    <telerik:RadTimeBar x:Name="timeBar" PeriodStart="{Binding RegistrationPeriodStart, Mode=OneWay}" PeriodEnd="{Binding RegistrationPeriodEnd, Mode=OneWay}"
         VisiblePeriodStart="11-Nov-2010 12:00:00 AM" VisiblePeriodEnd="14-March-2011 11:59:59 PM"
         SelectionStart="1-Jan-2011 12:00:00 AM" SelectionEnd="28-Feb-2011 11:59:59 PM"
         SelectionChanged="OnTimebarSelectionChanged">
        <telerik:RadTimeBar.Intervals>
            <telerik:YearInterval />
            <telerik:MonthInterval />
            <telerik:DayInterval />
        </telerik:RadTimeBar.Intervals>
     
        <telerik:RadLinearSparkline x:Name="sparkLineDaily"  XValuePath="RegistrationDate" YValuePath="RegistrationCountDailyTotal" ItemsSource="{Binding RegistrationCounts, Mode=OneWay}"/>
    </telerik:RadTimeBar>


    Etienne
  5. Yavor
    Admin
    Yavor avatar
    401 posts

    Posted 05 May 2011 Link to this post

    Hello EM,

    Thank you for sharing the solution!
    It is possible that your scenario reveals a bug in the TimeBar when it is configured in code behind. Can you please share a sample application so that we can investigate the situation in more detail and check what are the causes for this behavior.

    Kind regards,
    Yavor Ivanov
    the Telerik team
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
Back to Top