Specifying set date increments on X-Axis

TeeChart for Microsoft Visual Studio .NET, Xamarin Studio (Android, iOS & Forms) & Monodevelop.
Post Reply
Agrilink
Newbie
Newbie
Posts: 38
Joined: Thu Feb 02, 2006 12:00 am

Specifying set date increments on X-Axis

Post by Agrilink » Thu Feb 09, 2006 12:31 am

I'm reading data in from a database, with a datetime displayed on the x-axis and multiple numeric values on the y-axis using a Line series.

But I'm having a fundamental problem.

The datetime values are all at 15 minute intervals, eg. 1/1/2006 11:15 am

For basic testing, I've got two readings, eg. 1/1/2006 11:15 am and 1/1/2006 11:30am, with 10 valuesfor each datetime displayed on the y-axis.

I only want to display the two datetime values on the x-axis, but when the chart is rendered it automatically puts intervals in between, eg. 1/1/2006 11:20am and 1/1/2006 11:25am.

How do I only display the datetime values for which I've created Line series for?

Thanks in advance.

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

Post by Narcís » Thu Feb 09, 2006 10:13 am

Hi Agrilink,

You can set the axis increment you wish using:

Code: Select all

tChart1.Axes.Bottom.Increment = Steema.TeeChart.DateTimeSteps.FifteenMinutes;
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

Agrilink
Newbie
Newbie
Posts: 38
Joined: Thu Feb 02, 2006 12:00 am

Post by Agrilink » Thu Feb 09, 2006 10:06 pm

Thanks Narcis,

What I actually did was:

tChart1.Axes.Bottom.Increment = Utils.DateTimeStep[(int)DateTimeSteps.FifteenMinutes];

which I found in the online help.

Your suggestion didn't actually display the x-axis values.

Anyway, I'm now testing with "real" data. I've got data spanning several days, meaning there is 96 datetime intervals per day * number of days of data.

I know in the help it says if the data can't fit on the chart using the specified increment, the x-axis will automatically scale to fit all the data.

What I actually would like to do is specify say 5 readings per page and then have the user page through to the next block of readings.

My code is:

PageNumber pageNumber1 = new PageNumber();
tChart1.Tools.Add(pageNumber1);
tChart1.Page.MaxPointsPerPage = 5;

Then on a button click:

tChart1.Page.Next(); or tChart1.Page.Previous();

This code displays the number of pages and increments the current page on the button click, however all data is still displayed on the chart on the one page.

How can I accomplish what I'm trying to do.

Agrilink
Newbie
Newbie
Posts: 38
Joined: Thu Feb 02, 2006 12:00 am

Post by Agrilink » Thu Feb 09, 2006 10:37 pm

I've actually found the problem, I was setting the:

tChart1.Axes.Bottom.SetMinMax

which was causing all data to be displayed on the one page.

Post Reply