How do I turn off the datetime format?
Posted: Tue Jun 21, 2005 12:02 am
Axes.Botton Stuck on DateFormat
I have the latest build 2.0.1992.14012
I have a chart which I view Pressure points against Time(Years/dates). Then I view the same points against cumulative production (non-time). The bottom axis still comes out as a Time format with 0 being Jan 1, 1900.
How do I turn off the datetime format?
I add a tchart to a new form and one menu item. I add on non3D point series. The Chart first loads with time then by clicking the menu item it loads with cum data. Help in VB please.
Thanks
Dim IsTime As Boolean = True
Private Sub MenuItem1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MenuItem1.Click
If IsTime Then
IsTime = False
Else
IsTime = True
End If
Reload()
End Sub
Private Sub Form1_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles MyBase.Load
Reload()
End Sub
Private Sub Reload()
Dim arrayDate(3) As Date
Dim arrayPress(3) As Single
Dim arrayProd(3) As Single
Dim iterate As Short
Points1.Clear()
arrayDate(0) = DateSerial(1994, 6, 30)
arrayDate(1) = DateSerial(1999, 7, 21)
arrayDate(2) = DateSerial(2003, 8, 2)
arrayDate(3) = DateSerial(2005, 6, 1)
arrayPress(0) = 3005
arrayPress(1) = 2489
arrayPress(2) = 2159
arrayPress(3) = 1289
arrayProd(0) = 0
arrayProd(1) = 105.6
arrayProd(2) = 299.9
arrayProd(3) = 459.9
TChart1.Axes.Bottom.Labels.Style = Steema.TeeChart.AxisLabelStyle.Value
If IsTime Then
TChart1.Axes.Bottom.Labels.DateTimeFormat = "yyyy"
TChart1.Axes.Bottom.Title.Text = "Year"
TChart1.Axes.Bottom.Increment = Steema.TeeChart.Utils.GetDateTimeStep(Steema.TeeChart.DateTimeSteps.OneYear)
For iterate = 0 To 3
Points1.Add(arrayDate(iterate), arrayPress(iterate), CStr(iterate), Color.Red)
Next
TChart1.Axes.Bottom.SetMinMax(DateSerial(1994, 1, 1), DateSerial(2006, 1, 1))
Else
TChart1.Axes.Bottom.Title.Text = "Cumulative Gas (E6M3)"
TChart1.Axes.Bottom.Labels.ValueFormat = "#.## "
TChart1.Axes.Bottom.Increment = 5
For iterate = 0 To 3
Points1.Add(CDbl(arrayProd(iterate)), arrayPress(iterate), CStr(iterate), Color.Red)
Next
TChart1.Axes.Bottom.SetMinMax(CDbl(0), CDbl(500))
End If
TChart1.Axes.Left.Title.Text = "Pressure / ZFactor (kPa)"
TChart1.Axes.Left.SetMinMax(0, 4000)
End Sub
I have the latest build 2.0.1992.14012
I have a chart which I view Pressure points against Time(Years/dates). Then I view the same points against cumulative production (non-time). The bottom axis still comes out as a Time format with 0 being Jan 1, 1900.
How do I turn off the datetime format?
I add a tchart to a new form and one menu item. I add on non3D point series. The Chart first loads with time then by clicking the menu item it loads with cum data. Help in VB please.
Thanks
Dim IsTime As Boolean = True
Private Sub MenuItem1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MenuItem1.Click
If IsTime Then
IsTime = False
Else
IsTime = True
End If
Reload()
End Sub
Private Sub Form1_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles MyBase.Load
Reload()
End Sub
Private Sub Reload()
Dim arrayDate(3) As Date
Dim arrayPress(3) As Single
Dim arrayProd(3) As Single
Dim iterate As Short
Points1.Clear()
arrayDate(0) = DateSerial(1994, 6, 30)
arrayDate(1) = DateSerial(1999, 7, 21)
arrayDate(2) = DateSerial(2003, 8, 2)
arrayDate(3) = DateSerial(2005, 6, 1)
arrayPress(0) = 3005
arrayPress(1) = 2489
arrayPress(2) = 2159
arrayPress(3) = 1289
arrayProd(0) = 0
arrayProd(1) = 105.6
arrayProd(2) = 299.9
arrayProd(3) = 459.9
TChart1.Axes.Bottom.Labels.Style = Steema.TeeChart.AxisLabelStyle.Value
If IsTime Then
TChart1.Axes.Bottom.Labels.DateTimeFormat = "yyyy"
TChart1.Axes.Bottom.Title.Text = "Year"
TChart1.Axes.Bottom.Increment = Steema.TeeChart.Utils.GetDateTimeStep(Steema.TeeChart.DateTimeSteps.OneYear)
For iterate = 0 To 3
Points1.Add(arrayDate(iterate), arrayPress(iterate), CStr(iterate), Color.Red)
Next
TChart1.Axes.Bottom.SetMinMax(DateSerial(1994, 1, 1), DateSerial(2006, 1, 1))
Else
TChart1.Axes.Bottom.Title.Text = "Cumulative Gas (E6M3)"
TChart1.Axes.Bottom.Labels.ValueFormat = "#.## "
TChart1.Axes.Bottom.Increment = 5
For iterate = 0 To 3
Points1.Add(CDbl(arrayProd(iterate)), arrayPress(iterate), CStr(iterate), Color.Red)
Next
TChart1.Axes.Bottom.SetMinMax(CDbl(0), CDbl(500))
End If
TChart1.Axes.Left.Title.Text = "Pressure / ZFactor (kPa)"
TChart1.Axes.Left.SetMinMax(0, 4000)
End Sub