DateTime Problem with Bottom Axis Labels
Posted: Thu Oct 04, 2007 3:58 pm
Hi there
I've seen alot of posts with DateTime Problems but i don't found a post who fits with my problem.
My DateTimes wich i add to the series:
04.10.2007 17:50
05.10.2007 18:51
07.10.2007 20:53
10.10.2007 23:56
15.10.2007 04:00
DateTimes wich are displayed in my bottom axis labels:
03.10.2007 12:00:00
04.10.2007 00:00:00
04.10.2007 12:00:00
05.10.2007 00:00:00
05.10.2007 12:00:00
06.10.2007 00:00:00
06.10.2007 12:00:00
07.10.2007 00:00:00
07.10.2007 12:00:00
08.10.2007 00:00:00
08.10.2007 12:00:00
09.10.2007 00:00:00
09.10.2007 12:00:00
10.10.2007 00:00:00
10.10.2007 12:00:00
...
Something is going wrong, but i don't have a clue what it is.
I'm working with TeeChart v2.0
Here my Code:
I've seen alot of posts with DateTime Problems but i don't found a post who fits with my problem.
My DateTimes wich i add to the series:
04.10.2007 17:50
05.10.2007 18:51
07.10.2007 20:53
10.10.2007 23:56
15.10.2007 04:00
DateTimes wich are displayed in my bottom axis labels:
03.10.2007 12:00:00
04.10.2007 00:00:00
04.10.2007 12:00:00
05.10.2007 00:00:00
05.10.2007 12:00:00
06.10.2007 00:00:00
06.10.2007 12:00:00
07.10.2007 00:00:00
07.10.2007 12:00:00
08.10.2007 00:00:00
08.10.2007 12:00:00
09.10.2007 00:00:00
09.10.2007 12:00:00
10.10.2007 00:00:00
10.10.2007 12:00:00
...
Something is going wrong, but i don't have a clue what it is.
I'm working with TeeChart v2.0
Here my Code:
Code: Select all
this.WebChart1.Chart.Series[0].Clear();
System.Drawing.Color c = System.Drawing.Color.FromArgb(200, 164, 195, 234);
System.Drawing.Color c1 = System.Drawing.Color.FromArgb(200, 164, 195, 200);
Steema.TeeChart.Axis bAxis = this.WebChart1.Chart.Axes.Bottom;
this.WebChart1.Chart.Series[0].XValues.DateTime = true;
bAxis.Labels.DateTimeFormat = "dd.MM.yy HH:mm:ss";
bAxis.Increment = Steema.TeeChart.Utils.GetDateTimeStep(Steema.TeeChart.DateTimeSteps.OneHour);
bAxis.Labels.Angle = 90;
this.WebChart1.Chart.Panel.MarginBottom = 10;
DateTime dt = DateTime.Now;
ListBox1.Items.Clear();
for (int i = 0; i < 5; i++)
{
dt = dt.Add(new TimeSpan(i,i,i,i));
this.WebChart1.Chart.Series[0].Add(dt, i, c);
ListBox1.Items.Add(dt.ToString("dd.MM.yyyy HH:mm"));
}