Usage of the method Zoom.Activate

TeeChart for Microsoft Visual Studio .NET, Xamarin Studio (Android, iOS & Forms) & Monodevelop.
Post Reply
Glenn F. Henriksen
Newbie
Newbie
Posts: 52
Joined: Tue Mar 04, 2003 5:00 am

Usage of the method Zoom.Activate

Post by Glenn F. Henriksen » Thu Feb 03, 2005 10:35 am

I try to make a zoom (+ 10%) of a chart, centered on the mouse position.
I write a routine (VB.NET) who receive the event "ClickBackground".
My questions are :
1. The zoom is always done at the center of the chart and not in function of the mouse position.
2. The zoom is done Horizontally and vertically although I ask only Horizontal.

My source code follow :
Private Sub MyChart_ClickBackground(ByVal sender As System.Object, ByVal e As System.Web.UI.ImageClickEventArgs) Handles MyChart.ClickBackground

MyChart.Chart.Zoom.Active = True
MyChart.Chart.Zoom.ZoomPercent(110)
MyChart.Chart.Zoom.Direction=Steema.TeeChart.ZoomDirections.Horizontal
MyChart.Chart.Zoom.Activate(e.X, e.Y)

Have somebody meet the same experience ?
What are the solutions ?

Tahnks

Pep
Site Admin
Site Admin
Posts: 3295
Joined: Fri Nov 14, 2003 5:00 am
Contact:

Post by Pep » Fri Feb 11, 2005 10:49 am

Hi,
1. The zoom is always done at the center of the chart and not in function of the mouse position.
To do a zoom of Part of the Chart you will have to use the Chart.Zoom.ZoomRect() method.
2. The zoom is done Horizontally and vertically although I ask only Horizontal.
Yes, you're correct, it's a bug (TF02010402). We'll try to fix it for the next maintenance releases. In meantime a workaround is to add the following code in the OnZoomed event :

Code: Select all

private void tChart1_Zoomed(object sender, System.EventArgs e)
{
if (tChart1.Zoom.Direction == Steema.TeeChart.ZoomDirections.Horizontal)
tChart1.Axes.Left.Automatic = true;
}

Post Reply