Page 1 of 1
drag point tool
Posted: Tue Nov 30, 2004 7:41 am
by 9524558
Dear Pep
I've discovered by chance that there is a fantastic drag point tool in V7 (I did not find anything about it in the V7 demo) which I could use, and which would be great help for me. Unfortunately by checking out the Tutorial, and by clicking on GetlDsOfNames property (or method?) the tutorial tells me: "del5vcl.hlp cannot be found or missing"
My question: where I could learn more about the pont drag tool? What methods, poroperties it has, etc.
What I would like to do: I have a closed polygon formed by line series points. I would like to move it using the drag point tool by clicking on a single point of the polygon, and all the other points should move in concert with the clicked point. How could I do this?
Tx in advance, best regards
Andras
Posted: Wed Dec 01, 2004 11:31 am
by Pep
Hi Andras,
I've discovered by chance that there is a fantastic drag point tool in V7 (I did not find anything about it in the V7 demo)
Yes, you're correct, I'll add one example into it. Thanks for the advise.
by checking out the Tutorial, and by clicking on GetlDsOfNames property (or method?) the tutorial tells me: "del5vcl.hlp cannot be found or missing"
Yes, I can see, the problem is that thei method should not be showed as it's not available to use it. We'll remove it from the help.
My question: where I could learn more about the pont drag tool? What methods, poroperties it has, etc.
This tool only have the DragStyle and Series properties.
What I would like to do: I have a closed polygon formed by line series points. I would like to move it using the drag point tool by clicking on a single point of the polygon, and all the other points should move in concert with the clicked point. How could I do this?
Well, this should be easy to do using the OnDragPoint event but I've noticed that it has not been added. I'll add for the next maintenance release which will be ready soon. In meantime the only way around this that I can think of could be checking if any of the points (values) has been changed after the Chart is repainted, and if so update the values for the other points.
Posted: Wed Dec 01, 2004 2:14 pm
by 9524558
Well, this should be easy to do using the OnDragPoint event but I've noticed that it has not been added. I'll add for the next maintenance release which will be ready soon. In meantime the only way around this that I can think of could be checking if any of the points (values) has been changed after the Chart is repainted, and if so update the values for the other points.
Pep maybe you could elaborate this polygon movement example as an example for the point drag tool, and put it into the demo upgrade. I think it might be useful for many other TChart users.
Tx, regards
Andras
Posted: Thu Dec 02, 2004 9:21 am
by Pep
H Andras,
yes, an exmaple will be included, but in your case, I'm not sure what're you refereincing when you say "all the other points should move in concert with the clicked point". You mean that if I drag a point and their values has increased for example +2 then the others should be incremented with +2 ?
Posted: Thu Dec 02, 2004 2:54 pm
by 9524558
Hi Pep
Yes, exactly. So if I move move (drag) one point of the polygon, all the others should also move with the same extent, i.e. in this way the whole polygon moves. And because all points move in concert with the clicked (dragged) one, the polygon does not get distorted during the drag, it keeps shape. That would be something, which would be very useful. You could also include two option buttons into the example, one for polygon move (drag) as described above, and one for single point drag, where only one single (clicked) point of the polygon should move (and of course the polygon gets distorted, as the single point moves.)
best regards
Andras
Posted: Tue Dec 07, 2004 8:54 am
by Chris
Hi Andras,
Yes, exactly. So if I move move (drag) one point of the polygon, all the others should also move with the same extent, i.e. in this way the whole polygon moves. And because all points move in concert with the clicked (dragged) one, the polygon does not get distorted during the drag, it keeps shape. That would be something, which would be very useful. You could also include two option buttons into the example, one for polygon move (drag) as described above, and one for single point drag, where only one single (clicked) point of the polygon should move (and of course the polygon gets distorted, as the single point moves.)
Have you seen the VB6 example under:
TeeChart Pro v7 ActiveX\Examples\Visual Basic\Visual Basic 5 & 6\Dragging Points ?
You should easily be able to adapt this example to move all the points of your polygon rather than just one of them.
Posted: Tue Dec 07, 2004 10:36 am
by Pep
Hi,
one example could be :
Code: Select all
Dim YPointValues(5) As Integer
Private Sub Form_Load()
With TChart1
.Aspect.View3D = False
.AddSeries scLine
For i = 0 To 5
YPointValues(i) = Rnd * 100
Next i
.Series(0).AddArray i, YPointValues
.Series(0).asLine.Pointer.Visible = True
.Axis.Left.SetMinMax -100, 200
.Tools.Add tcDragPoint
.Tools.Items(0).asDragPoint.Series = .Series(0)
.Tools.Items(0).asDragPoint.DragStyle = dsY
Check1.Value = 1
End With
End Sub
Private Sub TChart1_OnDragPointToolDragPoint(ByVal Index As Long)
Dim Value
Value = YPointValues(Index) - TChart1.Series(0).YValues.Value(Index)
Label1.Caption = Index
For i = 0 To TChart1.Series(0).Count - 1
If i <> Index Then
TChart1.Series(0).YValues.Value(i) = YPointValues(i) - Value
End If
Next i
End Sub
Posted: Sun Dec 12, 2004 8:19 pm
by 9524558
Christopher Ireland wrote:Hi Andras,
Have you seen the VB6 example under:
TeeChart Pro v7 ActiveX\Examples\Visual Basic\Visual Basic 5 & 6\Dragging Points ?
You should easily be able to adapt this example to move all the points of your polygon rather than just one of them.
Hi Chris
Yes I remember this example, but this is not based on the drag point tool, but rather on the OnMouseMove event.
Tx anyway, best regards
Andras