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

Integration with RadTimeBar

6 Answers 201 Views
ChartView
This is a migrated thread and some comments may be shown as answers.
sysinfradev
Top achievements
Rank 1
sysinfradev asked on 18 Nov 2011, 04:32 PM
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.

6 Answers, 1 is accepted

Sort by
0
MikeWiese
Top achievements
Rank 1
answered on 22 Nov 2011, 05:55 AM
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
0
Tsvetie
Telerik team
answered on 23 Nov 2011, 11:04 AM
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 >>

0
MikeWiese
Top achievements
Rank 1
answered on 23 Nov 2011, 11:40 PM
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

0
Tsvetie
Telerik team
answered on 29 Nov 2011, 09:09 AM
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 >>

0
MikeWiese
Top achievements
Rank 1
answered on 29 Nov 2011, 10:03 AM
Unfortunately the Timebar's SelectionStart event only fires when the mouse is released, making a smooth scrolling effect impossible.
0
Tsvetie
Telerik team
answered on 01 Dec 2011, 03:07 PM
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 >>

Tags
ChartView
Asked by
sysinfradev
Top achievements
Rank 1
Answers by
MikeWiese
Top achievements
Rank 1
Tsvetie
Telerik team
Share this question
or