Reputation: 145
I want to draw a circle on LbuttonDown on Series. What I am doing is I am using DrawLine tool and adding a line on OnMouseDownTchart Event. But the Issue is as soon as i do Scroll Axis the line disappears.
Thanks Akshay
Upvotes: 0
Views: 212
Reputation: 5039
I'm trying to reproduce the problem with the code below but it seems to work fine for me here. It adds a line in a random position each time I click on the chart. And I can still scroll the chart dragging the same with the right mouse button.
Private Sub Form_Load()
TChart1.Aspect.View3D = False
TChart1.AddSeries scPoint
Dim i As Integer
For i = 0 To 20
TChart1.Series(0).Add i, "", clTeeColor
Next i
TChart1.Tools.Add tcDrawLine
TChart1.Tools.Items(0).asDrawLine.EnableDraw = 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)
With TChart1.Tools.Items(0).asDrawLine
.AddLine Rnd * 20, Rnd * 20, Rnd * 20, Rnd * 20
End With
End Sub
I'm using TeeChart ActiveX v2013.0.1.0.
Maybe you are doing something at OnMouseDown
that enters in conflict with the scroll action.
If you still find problems with it, please, improve the question being more specific. Some code would be helpful. Also I'm not sure to understand what "LbuttonDown on Series" means.
Upvotes: 1