Values from Screen

TeeChart for Microsoft Visual Studio .NET, Xamarin Studio (Android, iOS & Forms) & Monodevelop.
Post Reply
AGF
Newbie
Newbie
Posts: 34
Joined: Mon Feb 21, 2011 12:00 am

Values from Screen

Post by AGF » Tue Jul 26, 2011 11:35 am

I have an Axis system with Min / Max Values .... How can i receive coordinates of an Mousclick inside of these Axis system as X,Y Values ? (VB)


Thanks and Best Regards

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

Re: Values from Screen

Post by Sandra » Tue Jul 26, 2011 3:12 pm

Hello AGF,

I recommend that use the methods of axes CalcPosValue(), CalcPosXValue(),CalcPosYValue(), that I think help you to achieve as you want. And also, you can take a look in the Tutorial 4-Axis Control where you find any examples how you use these methods. If you have more questions about it please let me know.

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

AGF
Newbie
Newbie
Posts: 34
Joined: Mon Feb 21, 2011 12:00 am

Re: Values from Screen

Post by AGF » Wed Jul 27, 2011 1:03 pm

Dear Sandra,

like i understand the Calc funtions - they are depending on an existing ValueList eg. Series? But i have no Series, i have an xy "Grid" witch are defined from the Min/Max and increment of the axis and i want to get the position koordinates of an MouseClick in Values of the xyGrid - without any Series / ValueLists....

or i it necessary to add an empty series before i can receive values?

Thanks

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

Re: Values from Screen

Post by Sandra » Thu Jul 28, 2011 10:20 am

Hello AGF,
like i understand the Calc funtions - they are depending on an existing ValueList eg. Series? But i have no Series, i have an xy "Grid" witch are defined from the Min/Max and increment of the axis and i want to get the position coordinates of an MouseClick in Values of the xyGrid - without any Series / ValueLists....
or i it necessary to add an empty series before i can receive values?
If you want calculate the coordinates of the Axes, is necessary axes have values,otherwise if you try to calculate X and Y coordinates of Chart Grid, always you get zero, as result. Therefor, to calculate the correct values of axes coordinates, you need use method SetMinMax() to assign range of values to the axes, as do in next lines of code:

Code: Select all

    Public Sub New()
        ' This call is required by the Windows Form Designer.
        InitializeComponent()
        InitializeChart()
        ' Add any initialization after the InitializeComponent() call.
    End Sub
    Private Sub InitializeChart()
        TChart1.Axes.Bottom.SetMinMax(0, 10)
        AddHandler TChart1.MouseClick, AddressOf tChart1_MouseClick
    End Sub

    Private Sub tChart1_MouseClick(ByVal sender As System.Object, ByVal e As System.Windows.Forms.MouseEventArgs)
        Dim x As Double = TChart1.Axes.Bottom.CalcPosPoint(e.X)
        Me.Text = x.ToString()
    End Sub
Can you please, confirm us if previous code works as you expected?

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

AGF
Newbie
Newbie
Posts: 34
Joined: Mon Feb 21, 2011 12:00 am

Re: Values from Screen

Post by AGF » Thu Jul 28, 2011 1:06 pm

Dear Sandra,

Thats it! Thanks a lot.

Post Reply