Zoom on cutom axis

TeeChart for Microsoft Visual Studio .NET, Xamarin Studio (Android, iOS & Forms) & Monodevelop.
Post Reply
Markus
Newbie
Newbie
Posts: 23
Joined: Tue Nov 23, 2004 5:00 am
Location: Austria
Contact:

Zoom on cutom axis

Post by Markus » Sat Jan 15, 2005 5:00 pm

For me it seems, that the zoom functionalty does not work on custom axis. Is ther any bug report for this?

Thanks, Markus.

Marjan
Site Admin
Site Admin
Posts: 745
Joined: Fri Nov 07, 2003 5:00 am
Location: Slovenia
Contact:

Post by Marjan » Mon Jan 17, 2005 8:32 am

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);
}
Marjan Slatinek,
http://www.steema.com

Post Reply