It is possible to group several series in a single checkbox under a main serie, so that the checkbox in the main serie will serve to display or hide the whole group while each sub series could be controlled with their own individual checkbox?
For example, the image attached shows four series where T-A6:M1 is the main serie. The idea is that T-A6:M1 checkbox turns on and off the others and, at the same time, P10, p50 and p90 must keep their checkboxes working.
Checkbox for a series group
Checkbox for a series group
- Attachments
-
- example.JPG (62.02 KiB) Viewed 6429 times
Re: Checkbox for a series group
Hello JAV,
You could use OnClickLegend to control how the other series must respond when a concrete area is clicked (the area for the main series item).
Here it is an example:
This sets the "other series" to be active if the main series is set to active, and sets the "other series" to be hidden if the main series is hidden. If you want to remember the "other series" statuses before they are set to be hidden, you could use variables to do so.
You could use OnClickLegend to control how the other series must respond when a concrete area is clicked (the area for the main series item).
Here it is an example:
Code: Select all
Private Sub Form_Load()
TChart1.Aspect.View3D = False
Dim i As Integer
For i = 0 To 3
TChart1.AddSeries scFastLine
TChart1.Series(i).FillSampleValues
Next i
TChart1.Series(0).Title = "Main series"
TChart1.Series(0).Pen.Width = 3
TChart1.Legend.CheckBoxes = True
End Sub
Private Sub TChart1_OnClickLegend(ByVal Button As TeeChart.EMouseButton, ByVal Shift As TeeChart.EShiftState, ByVal X As Long, ByVal Y As Long)
If ((X >= TChart1.Legend.Left) And (Y >= TChart1.Legend.Top) And (X <= TChart1.Legend.Left + TChart1.Legend.Width) And (Y <= TChart1.Legend.Top + TChart1.Canvas.FontHeight + 5)) Then
Dim i As Integer
For i = 1 To TChart1.SeriesCount - 1
TChart1.Series(i).Active = TChart1.Series(0).Active
Next i
End If
End Sub
Best Regards,
Yeray Alonso Development & Support Steema Software Av. Montilivi 33, 17003 Girona, Catalonia (SP) | |
Please read our Bug Fixing Policy |
Re: Checkbox for a series group
Hello Yeray,
Excellent! thank you very much. This solved my problem
Best regards,
JAV
Excellent! thank you very much. This solved my problem
Best regards,
JAV