Integration with RadTimeBar

7 posts, 0 answers
  1. sysinfradev
    sysinfradev avatar
    5 posts
    Member since:
    Sep 2011

    Posted 18 Nov 2011 Link to this post

    Is this possible and supported? 

    I have an existing RadChart based project that I am currently developing and it starts to lag when I go over 2000 data points on one chart, I am keen to try this as an alternative but only if it supports the time bar.

    Many Thanks.
  2. MikeWiese
    MikeWiese avatar
    41 posts
    Member since:
    Apr 2007

    Posted 21 Nov 2011 Link to this post

    I agree. Wouldn't it be nice if you could set the RadChartView as the Content of the RadTimeBar and it all just worked...

    I've seen and tried the RadTimeBar + RadChart demo and that RadChart.TimeBar technique simply fails in the scenarios that constitute my world.

    Telerik guys, it would be wonderful if you could make the new RadChartView work nicely with RadTimeBar.

    Mike
  3. DevCraft banner
  4. Tsvetie
    Admin
    Tsvetie avatar
    1517 posts

    Posted 23 Nov 2011 Link to this post

    Hello,
    The new RadChartView control does not have built-in integration with RadTimeBar as RadChart. In case you are looking for an approach that would lead to the same result, that is, RadTimeBar filters the data for RadChart - this is currently not possible with RadChartView.

    Mike, in case you are looking for another kind of integration between the controls, please explain in detail the result you are after and I do my best to help you achieve it.

    Greetings,
    Tsvetie
    the Telerik team

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

  5. MikeWiese
    MikeWiese avatar
    41 posts
    Member since:
    Apr 2007

    Posted 23 Nov 2011 Link to this post

    In my world I am often called upon to trend historical data. So my charts consist of several series of values trended against time on the X-axis. Each series has a different range on the Y-axis, and each series has different dates on the x-axis (not like the RadTimebar demo where the multiple series share common X values)

    For me, a wonderful scenario would be where the visible date range of a RadChartView DateTimeContinuousAxis was slaved to (i.e. controlled by) the date-range of a RadTimeBar.  Essentially I would like to use the RadTimeBar as a smart scrollbar for a chart.  So as I selected and scrolled using the RadTimeBar (which might display data from one of the series), I would see the date range of the RadChartView update to match it, and my multiple traces would scroll and zoom accordingly.

    FYI I was playing with using a RadChart as the Content of a TimeBar. It nearly worked. But the Y-axis scrolled offscreen, and there several other visual glitches so I gave up. 

    Mike

  6. Tsvetie
    Admin
    Tsvetie avatar
    1517 posts

    Posted 29 Nov 2011 Link to this post

    Hi Mike,
    You should not have problems updating the x-axis range either of RadChart or of RadChartView, according to the selection of the RadTimeBar control. For example:
    <charting:AxisX Title="Date" DefaultLabelFormat="MMMM dd, yyyy"
        IsDateTime="True"
        AutoRange="False"
        MinValue="{Binding ElementName=timeBar1, Path=SelectionStart, Converter={StaticResource DateTimeToOADateConverter}}"
        MaxValue="{Binding ElementName=timeBar1, Path=SelectionEnd, Converter={StaticResource DateTimeToOADateConverter}}"
        Step="1"/>

    Here is the code of my converter:
    public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
    {
        if (value is DateTime)
            return ((DateTime)value).ToOADate();
     
        return null;
    }

    Depending on the expected result, you could alternatively use the ZoomScrollingSettings of RadChart to implement this integration.

    Regards,
    Tsvetie
    the Telerik team

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

  7. MikeWiese
    MikeWiese avatar
    41 posts
    Member since:
    Apr 2007

    Posted 29 Nov 2011 Link to this post

    Unfortunately the Timebar's SelectionStart event only fires when the mouse is released, making a smooth scrolling effect impossible.
  8. Tsvetie
    Admin
    Tsvetie avatar
    1517 posts

    Posted 01 Dec 2011 Link to this post

    Hello Mikewiese,
    Indeed the selection changes once the user releases the selection element and in my opinion, this is the correct approach, having performance in mind.

    In this case your scenario requires you to update the chart every time the mouse with the selection element moves, you should use the ActualSelectionStart and ActualSelectionEnd properties:
    <charting:AxisX Title="Date" DefaultLabelFormat="MMMM dd, yyyy"
        IsDateTime="True"
        AutoRange="False"
        MinValue="{Binding ElementName=timeBar1, Path=ActualSelectionStart, Converter={StaticResource DateTimeToOADateConverter}}"
        MaxValue="{Binding ElementName=timeBar1, Path=ActualSelectionEnd, Converter={StaticResource DateTimeToOADateConverter}}"
        Step="1"/>

    In case you want to update the chart only in case the change is at least one day, you can implement this by binding the axis' properties to properties of the view model, that depend on the ActualSelectionStart and ActualSelectionEnd properties.

    Best wishes,
    Tsvetie
    the Telerik team

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

Back to Top
DevCraft banner