Group: Forum Members
Last Active: 14 Years Ago
Posts: 2,
Visits: 1
|
Hi, I would like to move an existing annotation to a new location with the pointer still pointing at the same point on the graph. Is ArrowLength the property I need to change? If so, I would like to keep the anchor, but change the arrow length. Depends on the new location, the arrow length will lengthen and shorten dynamically. How would I do that? Here's my code: Dim currentAnchor As nev.NScalePointAnchor = CType(mMovingAnnotation.Anchor, nev.NScalePointAnchor)If transformViewToData(currentAnchor.VertAxisIndex, e.X, e.Y, scalePoint) ThenmMovingAnnotation.Anchor = New nev.NScalePointAnchor(Me.chart, nev.StandardAxis.PrimaryX, currentAnchor.VertAxisIndex, nev.StandardAxis.Depth, False, scalePoint)mMovingAnnotation.ArrowLength = New Nevron.GraphicsCore.NLength(10, Nevron.GraphicsCore.NRelativeUnit.ParentPercentage)Me.ChartControl.Refresh()End If****************************************************** Private Function transformViewToData(ByVal verticalAxisIndex As Integer, ByVal x As Integer, ByVal y As Integer, ByRef result As nevG.NVector3DD) As Boolean' transforms a click point to a point with coords scaled to a specific Y Axis on the chartresult = New nevG.NVector3DDDim ptViewPoint As New nevG.NPointF(CSng(x), CSng(y))Dim viewToScale As New nev.NViewToScale3DTransformation(Me.ChartControl.View.Context, Me.chart, nev.StandardAxis.PrimaryX, verticalAxisIndex, nev.StandardAxis.Depth, 0.0)Return viewToScale.Transform(ptViewPoint, result)End Function Thanks, Clara
|