Automatic bottom axes

TeeChart for Microsoft Visual Studio .NET, Xamarin Studio (Android, iOS & Forms) & Monodevelop.
Post Reply
oferyo
Newbie
Newbie
Posts: 1
Joined: Wed Feb 17, 2010 12:00 am

Automatic bottom axes

Post by oferyo » Thu Mar 04, 2010 10:52 am

Hi,

I need a graph that will always show the last 15 minutes of the data. In order to achieve it on every insert i update the Minimum and the Maximum

This is the code:

DateTime endTime = DateTime.UtcNow;
DateTime startTime = endTime.Subtract(new TimeSpan(0, 15, 0));

tchart.Axes.Bottom.Minimum = endTime.ToOADate();
tchart.Axes.Bottom.Maximum = startTime.ToOADate();

Can i do it automatically ?

Also, i need the offset (tchart.Axes.Left.MaximumOffset = 50; tchart.Axes.Left.MinimumOffset = 50;) to be only on the values of the last 15 minutes.

If i set it at the beginning it won't be accurate because the minimum and the maximum of the last 15 minutes always changing.

How can i achieve it?

Thanks,
Ofer

Yeray
Site Admin
Site Admin
Posts: 9614
Joined: Tue Dec 05, 2006 12:00 am
Location: Girona, Catalonia
Contact:

Re: Automatic bottom axes

Post by Yeray » Fri Mar 05, 2010 8:47 am

Hi Ofer,
oferyo wrote:Can i do it automatically ?
To do it automatically you should call this bottom axis rescale routine after adding your points.
oferyo wrote:Also, i need the offset (tchart.Axes.Left.MaximumOffset = 50; tchart.Axes.Left.MinimumOffset = 50;) to be only on the values of the last 15 minutes.

If i set it at the beginning it won't be accurate because the minimum and the maximum of the last 15 minutes always changing.
Here is another thread with an example of how you should rescale your left axis: http://www.teechart.net/support/viewtop ... f=4&t=9022

If you still have problems with it, please try to arrange a simple example project we can run as-is to reproduce the issue here.
Best Regards,
ImageYeray Alonso
Development & Support
Steema Software
Av. Montilivi 33, 17003 Girona, Catalonia (SP)
Image Image Image Image Image Image Please read our Bug Fixing Policy

Post Reply