Hi,
I am using the ActiveX version 7.0 and have a chart using checkboxes in the legend.
How can I work out programmatically which series the user has checked or unchecked?
Thanks
Roger
Working out which series are checked in the legend
-
- Site Admin
- Posts: 14730
- Joined: Mon Jun 09, 2003 4:00 am
- Location: Banyoles, Catalonia
- Contact:
Hi Roger,
Yes, you can use TeeChart's OnClickLegend and Legend's Clicked method as shown here:
Yes, you can use TeeChart's OnClickLegend and Legend's Clicked method 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)
Dim SeriesIndex As Integer
SeriesIndex = TChart1.Legend.Clicked(X, Y)
If (SeriesIndex <> -1) Then
TChart1.Header.Text.Clear
TChart1.Header.Text.Add "Series" & CStr(SeriesIndex + 1) & " Clicked!"
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 |
Thanks Narcís,
That could work, but it would be complicated for what I want to do.
When I close a chart, I want to note which series are currently checked and restore that state when I next create that chart. In other words, statically record the current state, rather than dynamically monitoring the changes.
Your suggestion would work - constantly monitoring click events and noting which series they relate to, then updating this through the life of the chart (as series are added and deleted etc.) but it seems complicated for my particular case.
Is there a way of finding out the current status at a point in time?
I was hoping there would be a simple property value for each series or something like that.
Thanks
Roger
That could work, but it would be complicated for what I want to do.
When I close a chart, I want to note which series are currently checked and restore that state when I next create that chart. In other words, statically record the current state, rather than dynamically monitoring the changes.
Your suggestion would work - constantly monitoring click events and noting which series they relate to, then updating this through the life of the chart (as series are added and deleted etc.) but it seems complicated for my particular case.
Is there a way of finding out the current status at a point in time?
I was hoping there would be a simple property value for each series or something like that.
Thanks
Roger
-
- Site Admin
- Posts: 14730
- Joined: Mon Jun 09, 2003 4:00 am
- Location: Banyoles, Catalonia
- Contact:
Hi Roger,
Yes, you should just check which series are visible in the chart using TChart1.Series(i).Active boolean property.
Yes, you should just check which series are visible in the chart using TChart1.Series(i).Active boolean property.
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 |