Remove series from TChartListBox without deleting the series from graph

TeeChart VCL for Borland/CodeGear/Embarcadero RAD Studio, Delphi and C++ Builder.
Post Reply
Rick
Newbie
Newbie
Posts: 2
Joined: Mon Jun 08, 2020 12:00 am

Remove series from TChartListBox without deleting the series from graph

Post by Rick » Tue Jul 21, 2020 10:11 pm

How do I keep a Graph series from showing up in a TChartListBox? I do not want to remove the series completely, just have it so the user can not see or select one or more of the series in the list box. When I set the Series[x].visible to false, the series does not show up in the graph or the legend. But the series remains visible and selectable in the list box. I am not looking to remove all the series from the list box, just make certain ones not appear, which may or may not become available after the user changes certain criteria. Hence I can not use RemoveSeries without a lot more code to re-add them when needed.

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

Re: Remove series from TChartListBox without deleting the series from graph

Post by Yeray » Fri Jul 24, 2020 7:27 am

Hello,

You can remove an item from the TChartListBox with the Items.Delete(AIndex) method. Ie:

Code: Select all

ChartListBox1.Items.Delete(0);
Then, you can reload all the Series from the Chart anytime with just:

Code: Select all

ChartListBox1.UpdateSeries;
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