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.
Specifying set date increments on X-Axis
-
- Site Admin
- Posts: 14730
- Joined: Mon Jun 09, 2003 4:00 am
- Location: Banyoles, Catalonia
- Contact:
Hi Agrilink,
You can set the axis increment you wish using:
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 |
Instructions - How to post in this forum |
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.
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.