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.
Syncfusion Feedback

Problems with Zoom

Thread ID:

Created:

Updated:

Platform:

Replies:

57198 Feb 27,2007 05:36 PM UTC Mar 8,2007 09:37 AM UTC Windows Forms 5
loading
Tags: Chart
Ana
Asked On February 27, 2007 05:36 PM UTC

Hello,

I have some problems with the zooming in the chart.
I have made an application where I want to take care of the zooming myself. I'm using zoomFactor and ZoomPosition for X and Y to calculate new ranges (to get new labels).
I'm saving the zoomFactor and ZoomPosition values on a stack in order to get correct ranges when i Zoom out again (triggered by double clicking in the chart).

1. Everything works as expected until I zoom out to the start position/view. I get correct ranges of the chart BUT some column/bars are not present anymore! What could possibly have gone wrong here? I attach a small application which represent this problem. Zoom in small parts at a time, zoom in 2-3 times. Double click to zoom out until you get to the startview. As you can see I don't get all columns/bars that were displayed at the startview (even though the whole area is shown).

2. Another thing that is strange here is that when I have zoomed out to get to the start view and I'm zooming in again I get very strange values of ZoomfactorX and ZoomPositionX. They really do not consist with the Max and Min value of the chart.
I thought that the ZoomFactor and ZoomPosition values always were calculated from the PrimaryX/Y.Range.Max/Min values but this does not seems to be correct.
Do you have any ides what could have gone wrong?

Best regards,
Ana

ZoomAndRescale0.zip

Ramya R [Syncfusion]
Replied On March 5, 2007 10:45 AM UTC

Hi Ana,

My strong apologies for the delay in getting back to you.

With regard to your first query, if your intention is to zoomout the chart when the Mouse is double clicked then it can be done by setting the ZoomFactorX and ZoomFactorY as shown in the code snippet below,

If Me.ChartControl1.EnableXZooming Then
Me.ChartControl1.ZoomFactorX = Math.Min(1.0F, Me.ChartControl1.ZoomFactorX * 2)
End If

If Me.ChartControl1.EnableYZooming Then
Me.ChartControl1.ZoomFactorY = Math.Min(1.0F, Me.ChartControl1.ZoomFactorY * 2)
End If

With regard to your second query, we are working on this and will update you within two days. Also could also please say us how do you want the values to be dispalyed after zooming the chart ( i.e) how do you want the range to be set after the chart is zoomed?

Let me know if you have any queries.

Thanks & Regards,
Ramya.

Administrator [Syncfusion]
Replied On March 7, 2007 11:31 AM UTC

Hi Ana,

If your intention is to get the Max and Min values of a ChartAxis while the chart is zoomed with the scrollbars made invisible then it can done by using the VisibleRange.Max and VisibleRange.Min properties of the ChartAxis. The VisbleRange.Max and VisibleRange.Min properties can be obtained as shown in the code snippet below,
Dim min, max As Double
max = Me.ChartControl1.PrimaryYAxis.VisibleRange.Max
min = Me.ChartControl1.PrimaryYAxis.VisibleRange.Min

The ZoomFactorX 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. Therefore, there will be twice as many interval points across the same range.
The ZoomPositionX is the offset position when zoomed along the X- axis.

In a similar manner, the ZoomFactorY and ZoomPositionY properties are used for Y- Axis.

Let me know if I am wrong in getting your requirement.

Thanks & Regards,
Ramya.

Administrator [Syncfusion]
Replied On March 7, 2007 11:33 AM UTC

With regard to your second query,if your intention is to get the Max and Min values of a ChartAxis while the chart is zoomed with the scrollbars made invisible then it can done by using the VisibleRange.Max and VisibleRange.Min properties of the ChartAxis. The VisbleRange.Max and VisibleRange.Min properties can be obtained as shown in the code snippet below,
Dim min, max As Double
max = Me.ChartControl1.PrimaryYAxis.VisibleRange.Max
min = Me.ChartControl1.PrimaryYAxis.VisibleRange.Min

The ZoomFactorX 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. Therefore, there will be twice as many interval points across the same range.
The ZoomPositionX is the offset position when zoomed along the X- axis.

In a similar manner, the ZoomFactorY and ZoomPositionY properties are used for Y- Axis.

Let me know if I am wrong in getting your requirement.

Thanks & Regards,
Ramya.

Administrator [Syncfusion]
Replied On March 7, 2007 11:37 AM UTC

Hi Ana,

Please ignore my last two replies.

With regard to your second query,if your intention is to get the Max and Min values of a ChartAxis while the chart is zoomed with the scrollbars made invisible then it can done by using the VisibleRange.Max and VisibleRange.Min properties of the ChartAxis. The VisbleRange.Max and VisibleRange.Min properties can be obtained as shown in the code snippet below,

Dim min, max As Double
max = Me.ChartControl1.PrimaryYAxis.VisibleRange.Max
min = Me.ChartControl1.PrimaryYAxis.VisibleRange.Min

The ZoomFactorX 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. Therefore, there will be twice as many interval points across the same range.
The ZoomPositionX is the offset position when zoomed along the X- axis.

In a similar manner, the ZoomFactorY and ZoomPositionY properties are used for Y- Axis.

Let me know if I am wrong in getting your requirement.

Thanks & Regards,
Ramya.





Administrator [Syncfusion]
Replied On March 8, 2007 09:37 AM UTC

Hi,

Thanks for the answer. I will try this instead.
I hope this solve the problem with the columns that disappears after zooming out.

Best regards
//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.

Warning Icon 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.Close Icon

;