I use a Selecor to select series, here is the constructor:
Code: Select all
Public Sub CreateSeriesSelector()
SeriesSelector = New Selector
SeriesSelector.Active = True
SeriesSelector.AllowDrag = False
SeriesSelector.SelectableParts = Nothing
Dim SelectableParts As New Object()
ReDim SelectableParts(Chart1.Series.Count)
For i As Integer = 0 To Chart1.Series.Count - 1
SelectableParts(i) = Chart1.Series(i)
If TypeOf Chart1.Series(i) Is Line Then
Dim l As Line = Chart1.Series(i)
If l.Pointer.Visible Then
Dim s As Integer = l.Pointer.HorizSize + 2
If l.Pointer.VertSize > s - 2 Then
s = l.Pointer.VertSize + 2
End If
SeriesSelector.HandleSize = s
End If
End If
If TypeOf Chart1.Series(i) Is Points Then
Dim l As Points = Chart1.Series(i)
Dim s As Integer = l.Pointer.HorizSize + 2
If l.Pointer.VertSize > s - 2 Then
s = l.Pointer.VertSize + 2
End If
SeriesSelector.HandleSize = s
End If
Next
SeriesSelector.SelectableParts = SelectableParts
If ActiveSeries IsNot Nothing Then SeriesSelector.Series = ActiveSeries
End Sub
Why?
Best regards
Uli