X-axis in dateTime format
Posted: Tue Sep 20, 2011 3:26 pm
In the application we have, user option to display x-axis in relative time (starting 0 seconds at the beginning of the recorded data and incrementing it with the rate of collection) or in absolute time with dateTime stamp of data collection. User should able to switch between absolute time and relative time with default shown in relative time.
When user opts for showing in absolute time of data recording, how can I get the X-axis display back to DateTime format? I have the following code showing the OADate representation, but not the actual date and time format. Please suggest a solution.
When user opts for showing in absolute time of data recording, how can I get the X-axis display back to DateTime format? I have the following code showing the OADate representation, but not the actual date and time format. Please suggest a solution.
Code: Select all
Private Function SetXAxisToAbsoluteTime()
Try
Dim i, j As Integer
Dim oldTime As New Date(myTimeTicks)
Dim timeInterval As Double = 1.0 / (rateOfDataCollection)
For i = 0 To HighlightedGraphPanel.Series.Count - 1
For j = 0 To HighlightedGraphPanel.Series(i).Count - 1
HighlightedGraphPanel.Series(i).XValues(j) = oldTime.AddSeconds(j * timeInterval).ToOADate
Next
Next
HighlightedGraphPanel.Axes.Bottom.Title.Text = "Time"
HighlightedGraphPanel.Axes.Bottom.Labels.DateTimeFormat = "hh:mm:ss.ffff"
Catch ex As Exception
MsgBox(ex.Message)
End Try
Return Nothing
End Function