Page 1 of 1

Usage of the method Zoom.Activate

Posted: Thu Feb 03, 2005 10:35 am
by 8119814
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

Posted: Fri Feb 11, 2005 10:49 am
by Pep
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;
}