Discovering new axis start and end times using AxisArrow

TeeChart for Microsoft Visual Studio .NET, Xamarin Studio (Android, iOS & Forms) & Monodevelop.
Post Reply
BenW
Advanced
Posts: 119
Joined: Wed Aug 10, 2005 4:00 am

Discovering new axis start and end times using AxisArrow

Post by BenW » Mon Oct 29, 2007 3:01 am

Hi

I've created an AxisArrow tool and associated it with my x-axis. The x-axis is time based. I've set the ScrollPercent on the AxisArrow to 10 percent. When I click on the left most arrow the start and end times of the x-axis are set back in time by 10% as expected. I need to be able to read the new start and end times that have been set on the x-axis so that I can feed these into a query that will be sent to our server to retrieve data between the new start and end times.

Is there a way I can read the x-axis start and end times, in order to achieve this functionality?

thanks,
Ben.

Narcís
Site Admin
Site Admin
Posts: 14730
Joined: Mon Jun 09, 2003 4:00 am
Location: Banyoles, Catalonia
Contact:

Post by Narcís » Tue Oct 30, 2007 9:03 am

Hi Ben,

Yes, you can try using tChart1.Axes.Bottom.Minimum and tChart1.Axes.Bottom.Maximum.

Hope this helps!
Best Regards,
Narcís Calvet / Development & Support
Steema Software
Avinguda Montilivi 33, 17003 Girona, Catalonia
Tel: 34 972 218 797
http://www.steema.com
Image Image Image Image Image Image
Instructions - How to post in this forum

BenW
Advanced
Posts: 119
Joined: Wed Aug 10, 2005 4:00 am

Post by BenW » Tue Oct 30, 2007 4:33 pm

... and these return doubles, so I'm using DateTime.FromOADate(...) to convert the double values to DateTime values - is this OK to do?

Also, I'm presuming this same mechanism will work for custom axes that are time based...

Narcís, is there a way to have the TeeChart time based axes automatically comply with the time format specified in the Regional Settings?

thanks,
Ben.

Narcís
Site Admin
Site Admin
Posts: 14730
Joined: Mon Jun 09, 2003 4:00 am
Location: Banyoles, Catalonia
Contact:

Post by Narcís » Wed Oct 31, 2007 10:16 am

Hi Ben,

Yes, that's right.
Narcís, is there a way to have the TeeChart time based axes automatically comply with the time format specified in the Regional Settings?
You should set tChart1.Axes.Bottom.Labels.DateTimeFormat to your machine's Regional Settings DateTime format, something like this:

Code: Select all

					tChart1.Axes.Bottom.Labels.DateTimeFormat = Application.CurrentCulture.DateTimeFormat.ShortTimePattern;
Best Regards,
Narcís Calvet / Development & Support
Steema Software
Avinguda Montilivi 33, 17003 Girona, Catalonia
Tel: 34 972 218 797
http://www.steema.com
Image Image Image Image Image Image
Instructions - How to post in this forum

BenW
Advanced
Posts: 119
Joined: Wed Aug 10, 2005 4:00 am

Post by BenW » Wed Oct 31, 2007 3:38 pm

Hey thanks Narcís!

It looks like I can logically OR ShortTimePattern and ShortDatePattern values, so that the labels are presented giving both the current DD/MM/YY and time information, so this works well.

Another prevalent problem I'd like to solve is one of displaying time labels at the first tick and last tick of the data presented. So for example right now, if I have my tick intervals at say 15 mins and the start point is at 12:46 and the end point is at 5:14, that first and last ticks are not labelled and it makes it diffucult to see where the actual start and end of data is, just by looking at the first and last labels. Do you have any recommendations on this issue?

thanks,
Ben.

Narcís
Site Admin
Site Admin
Posts: 14730
Joined: Mon Jun 09, 2003 4:00 am
Location: Banyoles, Catalonia
Contact:

Post by Narcís » Fri Nov 02, 2007 8:59 am

Hi Ben,

The only solution I can think of is using custom labels as shown in this thread.

Hope this helps!
Best Regards,
Narcís Calvet / Development & Support
Steema Software
Avinguda Montilivi 33, 17003 Girona, Catalonia
Tel: 34 972 218 797
http://www.steema.com
Image Image Image Image Image Image
Instructions - How to post in this forum

Post Reply