Setting Inital Zoom?

TeeChart for Microsoft Visual Studio .NET, Xamarin Studio (Android, iOS & Forms) & Monodevelop.
Post Reply
swong
Newbie
Newbie
Posts: 24
Joined: Thu Jan 15, 2004 5:00 am

Setting Inital Zoom?

Post by swong » Mon Jan 19, 2004 9:27 pm

Is there a way to set the inital zoom? (ie. the visible rectangle). I have tried setting the following:

TChart1.Zoom.Zoomed = true;
TChart1.Zoom.x0 = myRowView("X0");
TChart1.Zoom.x1 = myRowView("X1");
TChart1.Zoom.y0 = myRowView("Y0");
TChart1.Zoom.y1 = myRowView("Y1");

Where myRowView stores the x0, x1, y0, y1 that I gathered from the Zoom method.

Am I doing things correctly?

Thanks!

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

Post by Pep » Wed Jan 21, 2004 11:52 am

Hi,

you can use SetMinMax method for the bottom and left axis to set a inicial zoom.

swong
Newbie
Newbie
Posts: 24
Joined: Thu Jan 15, 2004 5:00 am

Post by swong » Wed Jan 21, 2004 4:32 pm

I've tried to implement your idea about setting the initial extents of the graph, but I've run into a problem. For some reason, I've determined that the UndoneZoom event is called before the Zoomed Event. (As a side note, could this cause some of the performance problems?).

I have a function within the UndoneZoom Event to reset the X axis to the max and min of the series (I've tried both TChart1.Axes.Bottom.AdjustMaxMin as well as setting the Maximum and Minimum Properties directly).

Since my UndoneZoom event resets the X axis, the Zoomed event does not seem to work (since I've reset the max and min values the x-axis does not scale).


I need to reset the Max/Min for the X-axis since I initally set it to reset from saved extents, but would still like to see the entire graph if they zoom out.


Any help would be appreciated.

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

Post by Pep » Thu Jan 22, 2004 11:25 am

Hi,
into a problem. For some reason, I've determined that the UndoneZoom event is called before the Zoomed Event. (As a side note, could this cause some of the performance problems?).
Yes, you're correct, this seems to be a bug. I've added it on our defect list to be reviewed for the next upcoming release.

In meantime you can add the following line :

Code: Select all

private void tChart1_UndoneZoom(object sender, System.EventArgs e)
{
  if (!tChart1.Zoom.Zoomed)
  {
    MessageBox.Show ("Undo Zoom");
  }
}

Post Reply