Page 1 of 1

Cursortool with DateTime X axis

Posted: Wed Jan 28, 2009 5:22 am
by 13051032
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

Posted: Wed Jan 28, 2009 6:26 am
by 13051032
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.

Posted: Wed Jan 28, 2009 9:41 am
by narcis
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"

Posted: Thu Jan 29, 2009 6:26 am
by 13051032
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.)

Posted: Thu Jan 29, 2009 11:29 am
by narcis
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