Date time axis
Posted: Tue Jan 11, 2005 5:10 pm
Hi,
I am trying to implement axes with date time labels, studied the tutorial, but for some reason, it does not work.
Here is my code:
DateTime[] dateTimes;
(...)
// populating series
line.XValues.DateTime = true;
tChart1.Series.Add(line);
for (int iTime=0;iTime<noTimes;iTime++)
{
xValues[iTime] = dateTimes[iTime];
yValues[iTime] = gsSeries[iPar,iLoc,iTime];
}
tChart1.Series[iLoc].Add(xValues,yValues);
tChart1.Series[iLoc].Title = gsLocations[iLoc];
tChart1.Series[iLoc].VertAxis=
Steema.TeeChart.Styles.VerticalAxis.Both;
tChart1.BackColor = Color.White;
// time axis at bottom
Steema.TeeChart.Axis bottom;
bottom = tChart1.Axes.Bottom;
bottom.Chart = tChart1.Chart;
bottom.Labels.DateTimeFormat = "yyyy-mm-dd hh:mm:ss";
bottom.Increment = (double)
Steema.TeeChart.DateTimeSteps.OneMinute;
bottom.AutomaticMinimum = true;
bottom.AutomaticMaximum = true;
bottom.Visible = true;
In this example the date time ranges from "1990-01-09 00:00:00" up to "1990-01-09 00:06:00" with a time step of 30 seconds.
However, at the bottom axis the first time label is "1990-00-09 12:00:00", while I expect 1990-01-09 00:00:00". Strange ...
At the other hand this time label is the only label I see, while I expect a label each minute (Steema.TeeChart.DateTimeSteps.OneMinute
) ??
The time series itself are properly displayed, but there is still a problem with displaying the time axis. Some help would be nice.
Thanks,
Antoon Koster
I am trying to implement axes with date time labels, studied the tutorial, but for some reason, it does not work.
Here is my code:
DateTime[] dateTimes;
(...)
// populating series
line.XValues.DateTime = true;
tChart1.Series.Add(line);
for (int iTime=0;iTime<noTimes;iTime++)
{
xValues[iTime] = dateTimes[iTime];
yValues[iTime] = gsSeries[iPar,iLoc,iTime];
}
tChart1.Series[iLoc].Add(xValues,yValues);
tChart1.Series[iLoc].Title = gsLocations[iLoc];
tChart1.Series[iLoc].VertAxis=
Steema.TeeChart.Styles.VerticalAxis.Both;
tChart1.BackColor = Color.White;
// time axis at bottom
Steema.TeeChart.Axis bottom;
bottom = tChart1.Axes.Bottom;
bottom.Chart = tChart1.Chart;
bottom.Labels.DateTimeFormat = "yyyy-mm-dd hh:mm:ss";
bottom.Increment = (double)
Steema.TeeChart.DateTimeSteps.OneMinute;
bottom.AutomaticMinimum = true;
bottom.AutomaticMaximum = true;
bottom.Visible = true;
In this example the date time ranges from "1990-01-09 00:00:00" up to "1990-01-09 00:06:00" with a time step of 30 seconds.
However, at the bottom axis the first time label is "1990-00-09 12:00:00", while I expect 1990-01-09 00:00:00". Strange ...
At the other hand this time label is the only label I see, while I expect a label each minute (Steema.TeeChart.DateTimeSteps.OneMinute
) ??
The time series itself are properly displayed, but there is still a problem with displaying the time axis. Some help would be nice.
Thanks,
Antoon Koster