Using datetime on x-axis
Posted: Mon Jul 12, 2004 1:45 pm
VB.NET.
I'm adding points to a line series. The x-axis is datetime and the y-axis is double. The problem I'm having, is that the datetime values being added are not exact increments of each other.
X-Axis Y-Axis
2004-07-01 21:00:00 3
2004-07-02 18:00:00 3
2004-07-03 20:00:00 3
2004-07-04 10:00:00 3
2004-07-05 21:00:00 4
2004-07-06 16:00:00 4
2004-07-07 16:00:00 4
I keep getting x-axis lables "in-between" these when I add the points. I only want the points of data I'm adding and nothing else. I didn't have this problem in VB6 when I was using the ActiveX version of the control.
Would it be easier to add these points as Text on the x-axis, and doubles on the y-axis?
Here's my code:
While dr.Read()
TChart1.Series(0).Add(dr.GetDate(0).Value, dr.GetDecimal(1).Value)
TChart1.Series(1).Add(dr.GetDate(0).Value, dr.GetDecimal(2).Value)
End While
Jeff
I'm adding points to a line series. The x-axis is datetime and the y-axis is double. The problem I'm having, is that the datetime values being added are not exact increments of each other.
X-Axis Y-Axis
2004-07-01 21:00:00 3
2004-07-02 18:00:00 3
2004-07-03 20:00:00 3
2004-07-04 10:00:00 3
2004-07-05 21:00:00 4
2004-07-06 16:00:00 4
2004-07-07 16:00:00 4
I keep getting x-axis lables "in-between" these when I add the points. I only want the points of data I'm adding and nothing else. I didn't have this problem in VB6 when I was using the ActiveX version of the control.
Would it be easier to add these points as Text on the x-axis, and doubles on the y-axis?
Here's my code:
While dr.Read()
TChart1.Series(0).Add(dr.GetDate(0).Value, dr.GetDecimal(1).Value)
TChart1.Series(1).Add(dr.GetDate(0).Value, dr.GetDecimal(2).Value)
End While
Jeff