hi,
I'm having a problem with the date time increment for a webChart on the bottom axis. I'm calulating values for each week this year and I need the chart to show one week increment on the bottom axis which spans the first week of the year (1.1.2007) all the way to the current week (15.6.2007) btw. I'm using (dd.mm.yyyy).
Currently I'm inserting datetime values and the graph changes the increment (increasing it) as time goes by. When I implemented this solution in march it worked just as I wanted (one value for each week increment and I have bottomAxis.increment = 7) now there doesn't seem to be any order to the increment.
Any help would be great.
DateTime increment on bottom axis
-
- Site Admin
- Posts: 14730
- Joined: Mon Jun 09, 2003 4:00 am
- Location: Banyoles, Catalonia
- Contact:
Hi Vidar,
You can try setting axis increment to a DateTimeStep being one week. You'll find more information on how to do that in Tutorial 4 - Axis Control. Tutorials can be found on TeeChart's program group.
You can try setting axis increment to a DateTimeStep being one week. You'll find more information on how to do that in Tutorial 4 - Axis Control. Tutorials can be found on TeeChart's program group.
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 |
I tried to do this
But since .Increment accepts only double then I tried
but that doesn't help.
Regards.
Code: Select all
WebChart1.Chart.Axes.Bottom.Increment = Steema.TeeChart.DateTimeSteps.OneWeek;
Code: Select all
WebChart1.Chart.Axes.Bottom.Increment = (double)Steema.TeeChart.DateTimeSteps.OneWeek;
Regards.
-
- Site Admin
- Posts: 14730
- Joined: Mon Jun 09, 2003 4:00 am
- Location: Banyoles, Catalonia
- Contact:
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 |
hi,
Now we are getting somewhere,
This is the code I'm using. I set the min to 01.01.2007 and max to the date today.
what i get as labels on the grid is the increment (1.1.2007, 15.1.2007, 1.2.2007,15.2.2007 ..... 1.6.2007, 15.6.2007) which is not the correct increment.
Regards
Now we are getting somewhere,
Code: Select all
WebChart1.Chart.Axes.Bottom.SetMinMax(DateTime.Parse("01.01.2007"), DateTime.Parse(day));
WebChart1.Chart.Axes.Bottom.Increment = Steema.TeeChart.Utils.GetDateTimeStep(Steema.TeeChart.DateTimeSteps.OneWeek);
what i get as labels on the grid is the increment (1.1.2007, 15.1.2007, 1.2.2007,15.2.2007 ..... 1.6.2007, 15.6.2007) which is not the correct increment.
Regards
-
- Site Admin
- Posts: 14730
- Joined: Mon Jun 09, 2003 4:00 am
- Location: Banyoles, Catalonia
- Contact:
Hi Vidar,
This is most likely because labels in a week interval don't fit in your axes without overlapping and TeeChart automatically avoids this overlapping. You can try setting labels angle to 90 degrees:
That way you'll know if it's a space problem.
This is most likely because labels in a week interval don't fit in your axes without overlapping and TeeChart automatically avoids this overlapping. You can try setting labels angle to 90 degrees:
Code: Select all
WebChart1.Chart.Axes.Bottom.Labels.Angle=90;
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 |