I can't figure out how to make this work.
I just want to allow the user to swap the Bottom Axis values based on ListBox7 selection (Numeric or Time)
If the user selects the first item (Numeric), the code works as I expect.
If the user selects the second item (Time) this is where the problem arises.
Code: Select all
Private Sub ListBox7_SelectedIndexChanged(sender As System.Object, e As System.EventArgs) Handles ListBox7.SelectedIndexChanged
'Axis Mode Select
Dim aa As Integer
Dim StartTime As Date
Dim EndTime As Date
Dim PlotAxisMode As Integer
StartTime = Now
' EndTime = Now + 60 Minutes TimeAdd(Job.StartTime, Double.Parse(TextBox11.Text))
'TimeAdd function does work correctly
PlotAxisMode = ListBox7.SelectedIndex
Select Case ListBox7.SelectedIndex
Case 0 'Numeric
For aa = 0 To 7
frm1.TChart1.Series(aa).XValues.DateTime = False
Next aa
frm1.TChart1.Axes.Bottom.Labels.ValueFormat = "#,##0"
frm1.TChart1.Axes.Bottom.Minimum = 0
frm1.TChart1.Axes.Bottom.Maximum = 60
Case 1 'Time
For aa = 0 To 7
frm1.TChart1.Series(aa).XValues.DateTime = True
Next aa
frm1.TChart1.Axes.Bottom.Labels.DateTimeFormat = "MM/dd/yyyy hh:mm tt"
frm1.TChart1.Axes.Bottom.Labels.ValueFormat = "#0:00"
'frm1.TChart1.Axes.Bottom.Minimum = StartTime.ToOADate()
'frm1.TChart1.Axes.Bottom.Maximum = EndTime.ToOADate()
End Select
End Sub
Note the number of vertical lines as well as the starting value of 0.
This is what I expected. On this Image, in "Time" mode, the starting value is "12/30/1899 12:00 AM".
I want it to be display whatever "Now" is ("11/13/2015 3:40 PM"). The ending value should display Now + 60 Minutes.
Also, it should have the same number of Vertical lines as in the 1st screen shot.
The only thing that should change is the text for the Bottom Axis.
In the code, the last 2 items are commented out.
If they are allowed to execute, only 1 vertical line appears, and the Bottom Axis text is "12/15/1963 12:00 AM"
So, What am I doing wrong?