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

[Solved] Setting Initial Viewport

2 Answers 81 Views
Chart for XAML
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Colin
Top achievements
Rank 1
Colin asked on 05 Oct 2012, 12:55 PM
Hi,

I am using the RadCartesianChart with a DateTimeContinuousAxis x-axis and LineSeries data.  Let's say I have 5 weeks worth of data and when the chart is initially shown, I want to be able to set the viewport to be centered on a given date and then show 3 days before and 3 days after as the initial view "window".  I want the user to then be able to leverage the ChartPanAndZoomBehavior (both set to horizontal) to zoom/pan in and out of the data.

Unfortunately, I can't seem to figure out how to do this.  I can get the pan and zoom working fine, but it shows all data at once initially.  If I try the zoom settings on the chart (MaxZoom, MinZoom, and Zoom), I can't seem to get it to zoom in and out, but can drill into a given range of dates.

I just started using this control, so any help would be appreciated.  So far, it's been fantastic and very easy to use.

Thanks for any help you can provide!
Colin

2 Answers, 1 is accepted

Sort by
0
Georgi
Telerik team
answered on 08 Oct 2012, 02:28 PM
Hi Colin,

Thank you very much for using our Windows 8 tools and for your kind words about our charting component.

If I understand your scenario correctly you can take advantage of the ScrollOffset property of RadChart. It works in logical units, here is a sample setup.:

- You have initial zoom factor of 5 applied along the X-axis
- You want to have the 3-d view displayed within the Viewport and have two views on the left and two on the right.

What you need to specify here is:

<telerikChart:RadCartesianChart ScrollOffset="-2,0">

Please let me know whether this helps you achieve the desired behavior.

Greetings,
Georgi
the Telerik team

Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

0
Colin
Top achievements
Rank 1
answered on 10 Oct 2012, 02:37 AM
Hi Georgi,

Thanks for the help on this.  The suggestion you made worked great for what I need to do now that I understand how these values are used and calculated.  Much appreciated!

Colin
Tags
Chart for XAML
Asked by
Colin
Top achievements
Rank 1
Answers by
Georgi
Telerik team
Colin
Top achievements
Rank 1
Share this question
or