Page 1 of 1

How to detect is an axis is used by a series?

Posted: Wed Dec 10, 2008 6:33 am
by 10545590
Hi !

Is there any easy way to detect if an axis is used by one (or more) series? Something like ....

Code: Select all

If Chart.CustomAxes[Nr].Used = True then .....
Greetz Doinik

Posted: Wed Dec 10, 2008 9:20 am
by narcis
Hi Dominik,

The only solution I can think of is doing something like this:

Code: Select all

  for i:=0 to Chart1.CustomAxes.Count - 1 do
  begin
    for j:=0 to Chart1.SeriesCount - 1 do
    begin
      if ((Chart1[j].CustomHorizAxis = Chart1.CustomAxes[i]) or
          (Chart1[j].CustomVertAxis = Chart1.CustomAxes[i])) then
      begin
        //Add your code here
      end;
    end;
  end;
Hope this helps!