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

How can I set PanOffset according to current Data

3 Answers 133 Views
ChartView
This is a migrated thread and some comments may be shown as answers.
Vadim
Top achievements
Rank 1
Vadim asked on 06 Mar 2012, 02:17 PM
Hello, 
I have an issue for ChartView - set scrollbar position according to current selection in GridView.
ChartView has horizontal DateTimeContinuousAxis. GridView contains Range Column (from, to).
Do you have any ideas, how to help me?

Thanks,
Vadim

3 Answers, 1 is accepted

Sort by
0
Petar Marchev
Telerik team
answered on 09 Mar 2012, 03:02 PM
Hi Vadim,

If I understand correctly - you have a chart view and a grid view and the grid view contains information about some timely intervals - such as a start date and an end date. When a row is selected - you need the chart to zoom into the selected interval.

There is no out-of-the-box feature that allows such a behavior. However, there are ways to achieve this. One is to manipulate the Zoom and PanOffset properties of the chart.

I have attached a project that demonstrates this. The grid view contains information about start date and end date. When I select a row - the start date and end date are extracted from the selected row. Then, based on the current chart axis width - the new Zoom and PanOffset are calculated and then set.

I hope this helps.

Greetings,
Petar Marchev
the Telerik team
Sharpen your .NET Ninja skills! Attend Q1 webinar week and get a chance to win a license! Book your seat now >>
0
Vadim
Top achievements
Rank 1
answered on 13 Mar 2012, 03:04 PM
Hi Petar,

Thanks a lot for the solution. It works for me in most cases.
But in some cases we need to display at X-Axis up to 5 or 15 minutes intervals. For this purpose Zoom and Pan doesn't work as expected. (Scroll is located far from the current interval). What can I do to change this behavior?

Best regards,
Vadim
0
Petar Marchev
Telerik team
answered on 16 Mar 2012, 10:44 AM
Hi Vadim,

Did you try to set the MinimumRangeSpan to a smaller value? In the previously provided project I have placed a style targeting a PanZoomBar in the user control's resources. There you can try to change the minimum range span. Currently there is a known issue - if the chart view is zoomed too much then the chart view will not draw values properly. That is why I had set the minimum range span in the first place.

However, you can try it to see if it will work for your project. If this is not applicable then I would have to suggest that you you pass a new items source to to the chart view when the selected item has changed. This way no zooming will be applied at all.

I am not familiar with your current requirements but may be a RadTimeBar will be a better fit for your project. You can examine the time bar's examples here.

Regards,
Petar Marchev
the Telerik team
Sharpen your .NET Ninja skills! Attend Q1 webinar week and get a chance to win a license! Book your seat now >>
Tags
ChartView
Asked by
Vadim
Top achievements
Rank 1
Answers by
Petar Marchev
Telerik team
Vadim
Top achievements
Rank 1
Share this question
or