i have to execute somefunction when user click on the legend (each series)
i am not using teelistbox1
is there any event available to know where the user is clicked on the legend ....?
if i use the teelistbox then can linked to the chart legend , so that only tee listbox appears and when user changes the legend alignment ...? can teelistbox also changes
pls advise me
aravind
Legend click
-
- Site Admin
- Posts: 14730
- Joined: Mon Jun 09, 2003 4:00 am
- Location: Banyoles, Catalonia
- Contact:
Hi Aravind,
Yes, you can do it using OnClickLegend event and using legend's Clicked method as shown here:
Yes, you can do it using OnClickLegend event and using legend's Clicked method as shown here:
Code: Select all
Private Sub Form_Load()
For i = 0 To TChart1.SeriesCount - 1
TChart1.Series(i).FillSampleValues 10
TChart1.Series(i).Color = vbBlue
Next
End Sub
Private Sub TChart1_OnClickLegend(ByVal Button As TeeChart.EMouseButton, ByVal Shift As TeeChart.EShiftState, ByVal X As Long, ByVal Y As Long)
Index = TChart1.Legend.Clicked(X, Y)
If (Index <> -1) Then
For i = 0 To TChart1.SeriesCount - 1
If (i = Index) Then
TChart1.Series(i).Color = vbRed
Else
TChart1.Series(i).Color = vbBlue
End If
Next
End If
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 |