Capture Showpoint from chart series lazarus / 55-TAChart ---------------------------------------------------------------------- madepabloh · 2014-08-23 17:34 I have a chart with multiple line series created on runtime, which list is showed in a ChartListBox. Now, I would like to capturethe properties of the serie selected in the charlist box (by its "onitemclick" event). The idea is to show all those options in different components what could be modified by the usser and inmediatly appied to the selected serie. Foe example, for to start with something, i added 2 label and 2 checkbuttons. I would like to capture the series title and tag, as well as the ShowPoints and Showlines options of that series. I tried this code, but it does not work for the showpoints and showlines options but for name and tag. What should be the correct way to do it? I would like to allow the user to modify many other options on runtime, such as line color, line width, point symbol, color, size, label, label fonts, etc. Code: [Select]procedure TMain.ChartListbox1ItemClick(ASender: TObject; AIndex: Integer); begin   Label3.Caption := ChartListBox1.Series[AIndex].Title;   Label2.Caption := InttoStr(ChartListBox1.Series[AIndex].Tag);   Label1.Caption := ChartListBox1.Series[AIndex].Name;   Checkbox2.Checked := ChartListBox1.Series[AIndex].showpoints;   Checkbox1.Checked := ChartListBox1.Series[AIndex].ShowLines; end;       The code not compiles for the last two functions. Obviously, this is not the correct way to do it, but i can´f figure out the correct method, thaing into account that it works for the other options of the serie i tried. Thanks ---------------------------------------------------------------------- wp · 2014-08-23 17:48 This is because the "Series[]" returned from the chartlistbox is the least specialized version in the series class hierarchy: a TCustomChartSeries which exposes only a few properties common to all series. Since your series are TLineSeries you should use a type-cast to get access the special properites of this series type. For safety you should check by means of the "is" operator whether the series really is a TLineSeries. In a cubic-spline series, for examples, symbols and lines are turned on and off in a different way. You can take advantage of this to distinguish such cases: Code: [Select]  if ChartListbox1.Series[AIndex] is TLineSeries then     Checkbox2.Checked := TLineSeries(ChartListBox1.Series[AIndex]).showpoints   else   if ChartListbox1.Series[AIndex] is TCubicSplineSeries then     Checkbox2.Checked := TCubicSplineSeries(ChartListbox1.Series[AIndex]).Pointer.Visible;   if ChartListbox1.Series[AIndex] is TLineSeries then     Checkbox1.Checked := TLineSeries(ChartListBox1.Series[AIndex]).ShowLines   else   if ChartListbox1.Series[AIndex] is TCubicSplineSeries then     Checkbox2.Checked := TCubicSplineSeries(ChartListbox1.Series[AIndex]).Pen.Visible; ---------------------------------------------------------------------- madepabloh · 2014-08-23 18:00 Thanks @wp, Yes, i was wonder why if the properties appear under the objects inspector they are not able to be captured in the same way than the other properties. I will check. Thanks!! Edited: It works perfect. Thanks!!