Legend-click event

TeeChart for Microsoft Visual Studio .NET, Xamarin Studio (Android, iOS & Forms) & Monodevelop.
Post Reply
asupriya
Advanced
Posts: 179
Joined: Mon Dec 01, 2008 12:00 am

Legend-click event

Post by asupriya » Wed Feb 25, 2009 6:04 am

I capture legendclick event of a chart and display legend editor to the user with the following code. I like to capture what color user has chosen in the editor for the series after the PenEditor is displayed to the user. How can i get the color chosen by the user from the PenEditor.

Code: Select all

Private Sub MyChart_ClickLegend(ByVal sender As Object, ByVal e As MouseEventArgs)
        Dim MyChart As Steema.TeeChart.Chart = CType(sender, Steema.TeeChart.Chart)

        Dim Index As Integer = MyChart.Legend.Clicked(e.X, e.Y)
        Dim Series As Steema.TeeChart.Styles.FastLine

        If ((Index <> -1) And (MyChart.Series.Count >= Index)) Then
            Series = CType(MyChart.Series(Index), Steema.TeeChart.Styles.FastLine)
            Steema.TeeChart.Editors.PenEditor.Edit(Series.LinePen)
            'Series.Color = Series.LinePen.Color
        End If
    End Sub

Yeray
Site Admin
Site Admin
Posts: 9612
Joined: Tue Dec 05, 2006 12:00 am
Location: Girona, Catalonia
Contact:

Post by Yeray » Wed Feb 25, 2009 12:23 pm

Hi asupriya,

The color is stored at LinePen.Color. The following code tests it.

Code: Select all

If ((Index <> -1) And (MyChart.Series.Count >= Index)) Then
            Series = CType(MyChart.Series(Index), Steema.TeeChart.Styles.FastLine)
            Steema.TeeChart.Editors.PenEditor.Edit(Series.LinePen)
            TChart1.Header.Font.Color = Series.LinePen.Color
        End If
Best Regards,
ImageYeray Alonso
Development & Support
Steema Software
Av. Montilivi 33, 17003 Girona, Catalonia (SP)
Image Image Image Image Image Image Please read our Bug Fixing Policy

Post Reply