Hi,
We are BNF Technology Inc.
We have a licnese of Teechart Activex Version 8.0.0.7.
I am not able to get label member at Bottom Axis and value member on left axis on OnCursorToolChange event.
can you please help that how can i get those values.
My Bottom Axis lable member is Datetime.
Thanks in Advance.
TR,
BNF Technology Inc.
Not able to Get Values at cursor position
-
- Newbie
- Posts: 5
- Joined: Wed Mar 03, 2010 12:00 am
Re: Not able to Get Values at cursor position
Hello,
You probably missed to convert from pixels to axis coordinates with CalcPosPoint function. The following seems to work fine for me here:
You probably missed to convert from pixels to axis coordinates with CalcPosPoint function. The following seems to work fine for me here:
Code: Select all
Private Sub TChart1_OnCursorToolChange(ByVal Tool As Long, ByVal X As Long, ByVal Y As Long, ByVal XVal As Double, ByVal YVal As Double, ByVal Series As Long, ByVal ValueIndex As Long)
With TChart1.Axis
TChart1.Header.Text.Text = "X: " + Str$(.Bottom.CalcPosPoint(X)) + ", Y: " + Str$(.Left.CalcPosPoint(Y))
End With
End Sub
Best Regards,
Yeray Alonso Development & Support Steema Software Av. Montilivi 33, 17003 Girona, Catalonia (SP) | |
Please read our Bug Fixing Policy |
-
- Newbie
- Posts: 5
- Joined: Wed Mar 03, 2010 12:00 am
Re: Not able to Get Values at cursor position
Hello,
Thanks for your early reply. But still my problem is not resolved.
In attachment, you can see the Chart in which
Left Axis is Value Member
Bottom Axis is Lable Member which is datetime.
Now the problem is that i am not able to get the Bottom AXIS LABEL TEXT at any Cursor position on OnCursorToolChange event.
i am using VBScript in which i have written OnCursorToolChange event.
in that event i tried following thing but none of that has given me the solution.
as per your suggession i tried the first one,
1. form1.TChart1.Header.Text.Text = "X: " + Str$(.Bottom.CalcPosPoint(X)) + ", Y: " + Str$(.Left.CalcPosPoint(Y))
but Str$ is not workign in VBScript that is for VB.Net.
2. I have also created TChart1_OnCursorToolChange Event in C# code but that event is not executed on CursorToolChange..i dont know why.
3. form1.TChart1.GetLabelsSeries(0).get_PointLabel(0) // not working in VBScript
4. index = form1.TChart1.Series(0).Count - 1
TChart1.Series(0).XValues.Value(index)// i am getting unspecified exception
5. form1.TChart1.Header.Text.Text=InterpolateLineSeries(0, form1.TChart1.Series(0).FirstValueIndex, form1.TChart1.Series(0).LastValueIndex, XVal)
using this 5th one, i am getting Yvalue of Series at cursor postion..but i am still not getting that how can i get Xvalue at Cursor position.
Can u please help me to display Xvalue member(DateTime) onCursorToolChange Event using VBScript.
Thanks in advance.
Thanks for your early reply. But still my problem is not resolved.
In attachment, you can see the Chart in which
Left Axis is Value Member
Bottom Axis is Lable Member which is datetime.
Now the problem is that i am not able to get the Bottom AXIS LABEL TEXT at any Cursor position on OnCursorToolChange event.
i am using VBScript in which i have written OnCursorToolChange event.
in that event i tried following thing but none of that has given me the solution.
as per your suggession i tried the first one,
1. form1.TChart1.Header.Text.Text = "X: " + Str$(.Bottom.CalcPosPoint(X)) + ", Y: " + Str$(.Left.CalcPosPoint(Y))
but Str$ is not workign in VBScript that is for VB.Net.
2. I have also created TChart1_OnCursorToolChange Event in C# code but that event is not executed on CursorToolChange..i dont know why.
3. form1.TChart1.GetLabelsSeries(0).get_PointLabel(0) // not working in VBScript
4. index = form1.TChart1.Series(0).Count - 1
TChart1.Series(0).XValues.Value(index)// i am getting unspecified exception
5. form1.TChart1.Header.Text.Text=InterpolateLineSeries(0, form1.TChart1.Series(0).FirstValueIndex, form1.TChart1.Series(0).LastValueIndex, XVal)
using this 5th one, i am getting Yvalue of Series at cursor postion..but i am still not getting that how can i get Xvalue at Cursor position.
Can u please help me to display Xvalue member(DateTime) onCursorToolChange Event using VBScript.
Thanks in advance.
- Attachments
-
- TeeChart.png (3.95 KiB) Viewed 18901 times
Re: Not able to Get Values at cursor position
Hello,
Excuse us for the delayed reply here.
Excuse us for the delayed reply here.
In VBScript the integers are converted to strings automatically.BNF Tech Inc. wrote:1. form1.TChart1.Header.Text.Text = "X: " + Str$(.Bottom.CalcPosPoint(X)) + ", Y: " + Str$(.Left.CalcPosPoint(Y))but Str$ is not workign in VBScript that is for VB.Net.
Find attached a simple ASP example using the TChart1_OnCursorToolChange event.BNF Tech Inc. wrote:2. I have also created TChart1_OnCursorToolChange Event in C# code but that event is not executed on CursorToolChange..i dont know why.
To get the top label from the left axis you could use this:BNF Tech Inc. wrote:3. form1.TChart1.GetLabelsSeries(0).get_PointLabel(0) // not working in VBScript
Code: Select all
TChart1.Axis.Left.Labels.Item(0).Text
I can put this, for example in the OnDoubleClick event and shows "Last X Value: 24" as expected:BNF Tech Inc. wrote:4. index = form1.TChart1.Series(0).Count - 1 TChart1.Series(0).XValues.Value(index)// i am getting unspecified exception
Code: Select all
TChart1.Header.Text.Text = "Last X Value: " & (TChart1.Series(0).XValues.Value(TChart1.Series(0).Count - 1))
I think you are complicating things more than necessary. Checking the OnCursorToolChange event definition to be as in the example attached above will probably make it work.BNF Tech Inc. wrote:5. form1.TChart1.Header.Text.Text=InterpolateLineSeries(0, form1.TChart1.Series(0).FirstValueIndex, form1.TChart1.Series(0).LastValueIndex, XVal) using this 5th one, i am getting Yvalue of Series at cursor postion..but i am still not getting that how can i get Xvalue at Cursor position.
Best Regards,
Yeray Alonso Development & Support Steema Software Av. Montilivi 33, 17003 Girona, Catalonia (SP) | |
Please read our Bug Fixing Policy |