Page 1 of 1

How to find the series type in a chart.

Posted: Sat Feb 06, 2016 4:24 am
by 16566546
My program creates a chart with a mixture of line series, fast line series, point series and bar series. I am using MultiBar := mbStacked (as I want to place my stacked bars at specified x-axis positions), which means that I have to generate a new series for each segment in the stacked bar.

When I select some new data, I want to clear only the bar series from the chart and leave the other series (which will be refreshed). How do I find the series type of each item in SeriesList, and how do I remove only bar series from the chart, without having to generate a parallel list of series types.

Thanks in advance

Errol

Re: How to find the series type in a chart.

Posted: Mon Feb 08, 2016 12:04 pm
by yeray
Hello Errol,

You can loop your series list and check the class of a series with "is" keyword. Ie:

Code: Select all

  for i:=Chart1.SeriesCount-1 downto 0 do
    if Chart1[i] is TBarSeries then
      Chart1.RemoveSeries(i);