I have used a standard series line to create a vertical line on the face of my chart where the user clicks. This means I can use all the series events (mouseenter, onclickseries etc) to let the user interact with the line which is helpful. I would like them to be able to move the line, much like it is possible to move a colour line. I have implemented my own scrolling and have problems with the colour line which is another reason I am using the series for this functionality.
So, is it possible to drag a series?
Thanks
Series as a Vertical Line
-
- Site Admin
- Posts: 14730
- Joined: Mon Jun 09, 2003 4:00 am
- Location: Banyoles, Catalonia
- Contact:
Hi Rossmc,
The easiest way to achieve that would be using a HorizontalLine series and a DragPoint tool and implement in the tool's DragPoint event that when a point is moved all other points are moved as well. You can do that using something like this:
The easiest way to achieve that would be using a HorizontalLine series and a DragPoint tool and implement in the tool's DragPoint event that when a point is moved all other points are moved as well. You can do that using something like this:
Code: Select all
Private Sub Form_Load()
TChart1.AddSeries scHorizLine
TChart1.Tools.Add tcDragPoint
TChart1.Tools.Items(0).asDragPoint.Series = TChart1.Series(0)
For i = 0 To 10
TChart1.Series(0).Add 10, "", clTeeColor
Next
TChart1.Axis.Bottom.SetMinMax 0, 100
End Sub
Private Sub TChart1_OnDragPointToolDragPoint(ByVal Index As Long)
For i = 0 To TChart1.Series(0).Count - 1
If (i <> Index) Then
TChart1.Series(0).XValues.Value(i) = TChart1.Series(0).XValues.Value(Index)
End If
Next
End Sub
Best Regards,
Narcís Calvet / Development & Support Steema Software Avinguda Montilivi 33, 17003 Girona, Catalonia Tel: 34 972 218 797 http://www.steema.com |
Instructions - How to post in this forum |
-
- Site Admin
- Posts: 14730
- Joined: Mon Jun 09, 2003 4:00 am
- Location: Banyoles, Catalonia
- Contact:
Hi Rossmc,
You can find upgrading information at our on-line order section. For further information please contact our sales dept. at sales@steema.com.
Yes, I can now think of a way of doing that in v6 but it's not much elegant as first only one point is repositioned and when the point is released the whole series is repositioned.I didn't mentio that I am still on version 6 of the control which does not appear to have the OnDragPointToolDragPoint event.
Is there a way to do something similar in version 6?
Code: Select all
Dim StartDrag As Boolean
Dim Index As Integer
Private Sub Form_Load()
TChart1.AddSeries scHorizLine
TChart1.Tools.Add tcDragPoint
TChart1.Tools.Items(0).asDragPoint.Series = TChart1.Series(0)
For i = 0 To 10
TChart1.Series(0).Add 10, "", clTeeColor
Next
TChart1.Axis.Bottom.SetMinMax 0, 100
StartDrag = False
End Sub
Private Sub TChart1_OnMouseDown(ByVal Button As TeeChart.EMouseButton, ByVal Shift As TeeChart.EShiftState, ByVal X As Long, ByVal Y As Long)
Index = TChart1.Series(0).Clicked(X, Y)
If (Index <> -1) Then
StartDrag = True
End If
End Sub
Private Sub TChart1_OnMouseUp(ByVal Button As TeeChart.EMouseButton, ByVal Shift As TeeChart.EShiftState, ByVal X As Long, ByVal Y As Long)
If StartDrag Then
For i = 0 To TChart1.Series(0).Count - 1
If (i <> Index) Then
TChart1.Series(0).XValues.Value(i) = TChart1.Series(0).XValues.Value(Index)
End If
Next
End If
StartDrag = False
End Sub
That event was included in TeeChart Pro v7 ActiveX.What version does that event available in?
What are my upgrade options/costs?
You can find upgrading information at our on-line order section. For further information please contact our sales dept. at sales@steema.com.
Best Regards,
Narcís Calvet / Development & Support Steema Software Avinguda Montilivi 33, 17003 Girona, Catalonia Tel: 34 972 218 797 http://www.steema.com |
Instructions - How to post in this forum |