for dummies: what is wrong? lazarus / 55-TAChart ---------------------------------------------------------------------- Nicole · 2022-10-20 11:22 I have a TAChart with 9 series. The user has a CheckListbox where he may choose, which of the series to display and which to hide. The click event of the checklistbox reads Code: Pascal  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i   for i:=0 to CheckListBox_COT.Count - 1 do begin     Chart_COT.Series[i].Active:=CheckListBox_COT.Checked[i]; Shall I say, it works? Partly. Because the series diver, which are set to active and those which are hidden. One time it is my first series to show its figures, then it is the third,... How to solve this better? And what about this i of the series? Where is the order of this series done? ---------------------------------------------------------------------- wp · 2022-10-20 11:32 There is a TChartListbox for exactly this purpose. Simply connect its Chart property to the chart with the series to be controlled, and the listbox will populate itself with all series in the chart (if you want to skip one or more series you must provide a handler for the OnAddSeries event and return ASkip := true). Each series will be displayed with its icon and title (like in the legend). There's a demo project in folder components/tachart/demo/listbox of your Lazarus installation. Quote from: Nicole on October 20, 2022, 01:22:50 pmAnd what about this i of the series? Where is the order of this series done? Every series has an Index property. ---------------------------------------------------------------------- Nicole · 2022-10-20 16:53 Thank you for your answer, would look nice - a "would". It does not behave as expected. If I click one series-box, nothing happens. If I click them all after passing the fourth of them, suddenly all series appear and then the first one behaves like expected. Yes, I changed their order at design time. At runtime all values are assigned in a method, which works ok. The problem occurs at dispalying the series. Yes, re-attach would probably help. Nevertheless, I want to avoid to re-do the settings for 9 series, 3 axes and 3 transformations..... ---------------------------------------------------------------------- wp · 2022-10-20 17:42 Sorry I don't understand what you are doing. QuoteOne time it is my first series to show its figures, [...]What does this mean: "to show its figures"? To show series marks? Or to show the series? The ChartListbox works only to show/hide the individual series of a chart. QuoteIf I click one series-box, nothing happens."series-box" is the checkbox in the ChartListbox? QuoteIf I click them all after passing the fourth of themPassed the fourth series to chartlistbox? You do not have to do anything special, just set ChartListbox1.Chart := Chart1 The attached demo creates two data lineseries plus a constantline series (for displaying the y=0 axis line) and puts them into a TChartListbox. There is an event handler for OnAddSeries which prevents the constantline to be included in the listbox. To show the individual steps everything is done by code at runtime, but it could be done in the object inspector at designtime as well. ---------------------------------------------------------------------- Nicole · 2022-10-21 12:29 Can we say in English, "One image says more than 1000 words"? I add an image with 2 screenshots. But from the beginning: This is the code I added new = my IDE added it to the form instead of the CheckListbox. Code: Pascal  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i object ChartListbox_COT: TChartListbox  Left = 117  Height = 173  Hint = 'Reihen auswählen'  Top = 211  Width = 177  Chart = Chart_COT  Options = [cloShowCheckboxes, cloShowIcons, cloRefreshOnSourceChange]  ItemHeight = 0  MultiSelect = True  ParentShowHint = False  ShowHint = True  TabOrder = 1end You see at the image: Just a form with my old checklistbox (first line reads "exit;" to take anything out) and the new TChartlistbox. I do one click (see screenshot where to) and expect all series to be displayed. Then I click at the checkbox you see at the screenshot and uncheck it by this. After doing this, a variety of series is displayed. Unfortunately, I cannot generate a "simple" project, as my database is used to add the data. ---------------------------------------------------------------------- Nicole · 2022-10-21 12:35 and to add: No, the other series do NOT have this effect and: Yes, this "Fond short" is the very series of which I changed the order. It was at the end of the list and I sent it by the Design-Tool- Editor at a higher place under "Fond long" ---------------------------------------------------------------------- wp · 2022-10-21 13:58 Still very special, without seeing the code I cannot say much. Except for this: In both screenshots I see your CheckListbox together with a TChartListbox. Both have the purpose to show/hide series. Are you sure that both are not acting against each other? ---------------------------------------------------------------------- Nicole · 2022-10-21 16:54 Yes, I am sure. As I wrote above, that the original listbox method has an "exit;" in its first line. They are not interacting. The problem are the series. They was the problem in the listbox as I posted this. And there is the SAME problem in the chartListbox. So my question, is there anything, what I can do to "line up" those series? I am pretty sure, that there is an internal order of those series which is not properly sync with the series editor which allows moving those series up or down. Is there anywhere an index to set in the properties of the chart and group tag in those series or anything? There SHOULD be such a thing, otherwise there cannot be an editor at design time, which allows moving those series up and down in their order. There must be something behind the scene which saves my edits at design time. Probably there happened a mistake. ---------------------------------------------------------------------- wp · 2022-10-21 18:15 Quote from: Nicole on October 21, 2022, 06:54:58 pmYes, I am sure. As I wrote above, that the original listbox method has an "exit;" in its first line.That cryptic part of your message was hard to understand because there is not source attached (only a part of the lfm file). Quote from: Nicole on October 21, 2022, 06:54:58 pmSo my question, is there anything, what I can do to "line up" those series? I am pretty sure, that there is an internal order of those series which is not properly sync with the series editor which allows moving those series up or down. Is there anywhere an index to set in the properties of the chart and group tag in those series or anything? There SHOULD be such a thing, otherwise there cannot be an editor at design time, which allows moving those series up and down in their order. There must be something behind the scene which saves my edits at design time. Probably there happened a mistake. I wrote this earlier: Every series has an Index property. Isn't this what you want? ---------------------------------------------------------------------- Nicole · 2022-10-25 18:58 Yes, may be, that this would be a solution. Unfortunately, I cannot find an index property in the object inspector showing the series. How else can I find them? Thanks. ---------------------------------------------------------------------- wp · 2022-10-25 21:00 It is a public property only. Assign the value in your code.