Page 1 of 1

Specifying set date increments on X-Axis

Posted: Thu Feb 09, 2006 12:31 am
by 9640166
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.

Posted: Thu Feb 09, 2006 10:13 am
by narcis
Hi Agrilink,

You can set the axis increment you wish using:

Code: Select all

tChart1.Axes.Bottom.Increment = Steema.TeeChart.DateTimeSteps.FifteenMinutes;

Posted: Thu Feb 09, 2006 10:06 pm
by 9640166
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.

Posted: Thu Feb 09, 2006 10:37 pm
by 9640166
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.