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
Usage of the method Zoom.Activate
-
- Newbie
- Posts: 52
- Joined: Tue Mar 04, 2003 5:00 am
Hi,
To do a zoom of Part of the Chart you will have to use the Chart.Zoom.ZoomRect() method.1. The zoom is always done at the center of the chart and not in function of the mouse position.
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 :2. The zoom is done Horizontally and vertically although I ask only Horizontal.
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;
}
Pep Jorge
http://support.steema.com
http://support.steema.com