We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy.
Unfortunately, activation email could not send to your email. Please try again.

Zoom behaviour

Thread ID:

Created:

Updated:

Platform:

Replies:

56829 Feb 21,2007 09:35 AM Mar 8,2007 04:34 AM Windows Forms 4
loading
Tags: Chart
Ana
Asked On February 21, 2007 09:35 AM

Hi,

I need to tweak the built-in zoom in the chart in order to get similar behaviours as our other charts (another component).

1) Is it possible to hide the scrollers that appears when zooming? I would like to handle the unzooming in another way.

2) Is there any event I can use that is fired when the zoom selection has been made? I here want to execute my own axis scale code.

3) Is it possible to get the new coordinates of the selected zoom rectangle? Needed in order to perform my own rescale code of the axis.

Best regards,
Ana

Ben Tsai
Replied On February 21, 2007 04:56 PM

Hi Ana,

-
>Hi,
I need to tweak the built-in zoom in the chart in order to get similar behaviours as our other charts (another component).

1) Is it possible to hide the scrollers that appears when zooming? I would like to handle the unzooming in another way.
-

See this thread for the answer:
http://www.syncfusion.com/support/forums/message.aspx?MessageID=53658

-
2) Is there any event I can use that is fired when the zoom selection has been made? I here want to execute my own axis scale code.
-

Yes, I believe the event that you want is ChartControl.VisibleRangeChanged. This is what I am using to do my own custom zooming.

-
3) Is it possible to get the new coordinates of the selected zoom rectangle? Needed in order to perform my own rescale code of the axis.
-

You can use ChartControl.ZoomPositionX and ChartControl.ZoomFactorX (or the corresponding Y properties).

ZoomPositionX tells you the percentage of the whole that has been zoomed in. It is an offset. For example, if your original chart was 100 pixels wide, and ZoomPositionX is 0.25, then your new region starts at pixel 25.

ZoomFactorX tells you, ostensibly, the factor of the zoom. A ZoomFactorX of 1 means no zooming, a ZoomFactorX of 0.5 means the chart has been zoomed in 2x.

Hope that makes sense and that it helps!
Best regards,
BenT

Best regards,
Ana

Ana
Replied On February 22, 2007 05:27 AM

Thanks BenT for the answer!

Ramya R [Syncfusion]
Replied On March 6, 2007 06:54 AM

Hi Ana,

I have created a sample with regard to your queries here and attached with this post.

With regard to your first query, the Scrollbars can also be made invisible by using the below code,

this.chartControl1.GetVScrollBar(this.chartControl1.PrimaryYAxis).Visible = false;
this.chartControl1.GetHScrollBar(this.chartControl1.PrimaryXAxis).Visible = false;

Regarding your second query, As said by BenT you can use the VisibleRangeChanged event to perform functionalities which you want to do when the chart is zoomed.

With regard to you third query, If your intention is to obtain the Max and Min values of a axis which appear after zooming when the scrollbars are absent then it can be obtained using the VisibleRange.Max and VisibleRange.Min properties of a particular axis.
The ZoomingFactor property of a axis can be used for setting the interval(interval which appears after zooming the chart) between the values along the axis . The zooming factor is the value by which intervals are multiplied to have the effect of a more fine grained range. For example, if the calculated interval is 5 and the zoom factor is 0.5, then the zoomed interval with this zoom factor will be 2.5.

Kindly download the sample from the html page whose link is provided below,

http://websamples.syncfusion.com/samples/Chart.Windows/F56829/main.htm

Take a look at the sample and let me know whether this helps you.

Thanks & Regards,
Ramya

Administrator [Syncfusion]
Replied On March 8, 2007 04:34 AM

Thank you, this really help me!

//Ana

CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.

;