Page 1 of 1

Zoom on cutom axis

Posted: Sat Jan 15, 2005 5:00 pm
by 8127944
For me it seems, that the zoom functionalty does not work on custom axis. Is ther any bug report for this?

Thanks, Markus.

Posted: Mon Jan 17, 2005 8:32 am
by Marjan
Hi.

Yes, you're correct, this one is a missing feature. Custom axes do not support automatic zooming. This has to be done manually via code. The zooming and unzooming can be controlled with chart axis SetMinMax method and Automatic property. In the example below I've used tChart Zoomed and UndoneZoom events to zoom and reset axis scale

Code: Select all

private void tChart1_UndoneZoom(object sender, System.EventArgs e)
{
  line1.GetVertAxis.Automatic = true;      
}

private void tChart1_Zoomed(object sender, System.EventArgs e)
{
  Steema.TeeChart.Axis axis = line1.GetVertAxis;
  double amin = axis.CalcPosPoint(line1.Chart.Zoom.y0);
  double amax = axis.CalcPosPoint(line1.Zoom.y1);
  axis.Automatic = false;
  axis.SetMinMax(amin,amax);
}