X-axis in dateTime format

TeeChart for Microsoft Visual Studio .NET, Xamarin Studio (Android, iOS & Forms) & Monodevelop.
Post Reply
asupriya
Advanced
Posts: 179
Joined: Mon Dec 01, 2008 12:00 am

X-axis in dateTime format

Post by asupriya » 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.

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

Sandra
Site Admin
Site Admin
Posts: 3132
Joined: Fri Nov 07, 2008 12:00 am

Re: X-axis in dateTime format

Post by Sandra » Wed Sep 21, 2011 12:06 pm

Hello asupriya,

I recommend take a look in this thread, where the discussion talk about of relative and absolute values and I think it can useful for you.

I hope will helps.

Thanks,
Best Regards,
Sandra Pazos / Development & Support
Steema Software
Avinguda Montilivi 33, 17003 Girona, Catalonia
Tel: 34 972 218 797
http://www.steema.com
Image Image Image Image Image Image
Instructions - How to post in this forum

Post Reply