Page 1 of 1
How can you determine which legend item has been clicked
Posted: Tue Jan 24, 2006 3:37 pm
by 9525312
I have a legend on a chart with checkboxes. I have been looking through the ChartEvents but cant seem to find one that is fired when the checkbox for a series is changed, does such an event occur ?
Posted: Tue Jan 24, 2006 3:51 pm
by narcis
Hi AR,
Yes, you can use OnClickLegend event and the legend clicked event to obtain the clicked item index as shown here:
Code: Select all
Private Sub TChart1_OnClickLegend(ByVal Button As TeeChart.EMouseButton, ByVal Shift As TeeChart.EShiftState, ByVal X As Long, ByVal Y As Long)
TChart1.Header.Text.Clear
TChart1.Header.Text.Add (CStr(TChart1.Legend.Clicked(X, Y)))
End Sub
Posted: Tue Jan 24, 2006 4:29 pm
by 9525312
Thanks that worked, I had found that event and dismissed it as it didnt provide a series index.
Posted: Wed Jan 25, 2006 8:37 am
by narcis
Hi AR,
I'm glad to hear that did what you needed. Clicked method can be used to retrieve series points index in events where screen coordinates are provided.