Page 1 of 1

Values from Screen

Posted: Tue Jul 26, 2011 11:35 am
by 15658604
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

Re: Values from Screen

Posted: Tue Jul 26, 2011 3:12 pm
by 10050769
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,

Re: Values from Screen

Posted: Wed Jul 27, 2011 1:03 pm
by 15658604
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

Re: Values from Screen

Posted: Thu Jul 28, 2011 10:20 am
by 10050769
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,

Re: Values from Screen

Posted: Thu Jul 28, 2011 1:06 pm
by 15658604
Dear Sandra,

Thats it! Thanks a lot.