Cursortool with DateTime X axis

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

Cursortool with DateTime X axis

Post by asupriya » Wed Jan 28, 2009 5:22 am

This is an urgent issue and prompt response is much appreciated.

I have X-axis to represent DateTime values and on this chart I have a cursortool. I set the cursorTool1.FollowMouse = True and defined the handler for cursorTool1.Change. When the cursorTool1.Change event is triggered, I do not get the XValue of Steema.TeeChart.Tools.CursorChangeEventArgs correctly. It gives some large value. How can i get DateTime representation of cursortool1.change event?

I uploaded a test project to show my issue. The project is named as Test-TeeChartProj-28Jan2009.zip

asupriya
Advanced
Posts: 179
Joined: Mon Dec 01, 2008 12:00 am

Post by asupriya » Wed Jan 28, 2009 6:26 am

In addition to above question, I need to be able to get the Markstip tool's tooltip message with resolution of seconds. Now, when i display a 15 minute worth of data (series is populated with points at few seconds apart), all i can get from the zoom and markstip tool's tooltip is resolution of minutes. I want to know how i can get the resolution of seconds especially with marktip's tooltip and when the axis is zoomed to a resolution of seconds.

Narcís
Site Admin
Site Admin
Posts: 14730
Joined: Mon Jun 09, 2003 4:00 am
Location: Banyoles, Catalonia
Contact:

Post by Narcís » Wed Jan 28, 2009 9:41 am

Hi asupriya,
I have X-axis to represent DateTime values and on this chart I have a cursortool. I set the cursorTool1.FollowMouse = True and defined the handler for cursorTool1.Change. When the cursorTool1.Change event is triggered, I do not get the XValue of Steema.TeeChart.Tools.CursorChangeEventArgs correctly. It gives some large value. How can i get DateTime representation of cursortool1.change event?
You need to use FromOADate method:

Code: Select all

        eventLbl.Text = "e.xvalue = " & DateTime.FromOADate(e.XValue).ToString() & " e.yvalue = " & e.YValue
For more information on how Date type works please have a look here:

http://msdn.microsoft.com/en-us/library/3eaydw6e.aspx
In addition to above question, I need to be able to get the Markstip tool's tooltip message with resolution of seconds. Now, when i display a 15 minute worth of data (series is populated with points at few seconds apart), all i can get from the zoom and markstip tool's tooltip is resolution of minutes. I want to know how i can get the resolution of seconds especially with marktip's tooltip and when the axis is zoomed to a resolution of seconds.
You can do something like this:

Code: Select all

        MarksTip1 = New Steema.TeeChart.Tools.MarksTip(TChart1.Chart)
        MarksTip1.Style = Steema.TeeChart.Styles.MarksStyles.XValue
        TChart1.Axes.Bottom.Labels.DateTimeFormat = "dd/mm/yyyy hh:mm:ss"
Best Regards,
Narcís Calvet / 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

asupriya
Advanced
Posts: 179
Joined: Mon Dec 01, 2008 12:00 am

Post by asupriya » Thu Jan 29, 2009 6:26 am

Thanks for the help. It worked as expected.

I have one more need. I need to synchronize cursor across a series of vertically aligned charts (all having DateTime format for Bottom axis). When i tried to set other chart's otherCharts.Tools.cursortool.xvalue = e.xvalue of the cursortool1.change event's CursorChangeEventArgs, its not working (but not giving any error either).

Can you please suggest some solution? (You can see this in the test project i uploaded yesterday. You need to simply uncomment the part of code that creates as many charts as the panels in the form.)

Narcís
Site Admin
Site Admin
Posts: 14730
Joined: Mon Jun 09, 2003 4:00 am
Location: Banyoles, Catalonia
Contact:

Post by Narcís » Thu Jan 29, 2009 11:29 am

Hi asupriya,

This is because bottom chart and the other charts don't have same data range and therefore same axes scales. Populating all them in the same way solves the problem. For example, populating bottom chart like this:

Code: Select all

        For k As Integer = 0 To 100
            FastLine1.Add(myDateTime.AddSeconds(k * 60), myRand.Next(5555))
        Next
Best Regards,
Narcís Calvet / 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