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. Image for the cookie policy date

Zoom behaviour

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

4 Replies

BT Ben Tsai February 21, 2007 09:56 PM UTC

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


AN Ana February 22, 2007 10:27 AM UTC

Thanks BenT for the answer!


RR Ramya R Syncfusion Team March 6, 2007 11:54 AM UTC

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


AD Administrator Syncfusion Team March 8, 2007 09:34 AM UTC

Thank you, this really help me!

//Ana

Loader.
Live Chat Icon For mobile
Up arrow icon