Page 1 of 1

Setting Inital Zoom?

Posted: Mon Jan 19, 2004 9:27 pm
by 8123490
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!

Posted: Wed Jan 21, 2004 11:52 am
by Pep
Hi,

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

Posted: Wed Jan 21, 2004 4:32 pm
by 8123490
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.

Posted: Thu Jan 22, 2004 11:25 am
by Pep
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");
  }
}