Page 1 of 1

Remove series from TChartListBox without deleting the series from graph

Posted: Tue Jul 21, 2020 10:11 pm
by 16588866
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.

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

Posted: Fri Jul 24, 2020 7:27 am
by yeray
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;