Page 1 of 1

getfreeseriescolor

Posted: Fri Feb 10, 2006 6:46 pm
by 9340301
Hello...

I am adding around 30-100 series to a graph at runtime, but i am running out
of new colors for the new series. How can I use the GetFreeSeriesColor
function to look for more than 16 colors? Or is there another way around
this? Thanks for your help.

Cheers,
Nico

Posted: Mon Feb 20, 2006 11:08 am
by Pep
Hi Nico,

a way around could be to define your custom Array of colors and use it like in the following code :

Code: Select all


Const ColorP:Array[1..10] of TColor= 
        ( clRed, 
          clGreen, 
          clYellow, 
          clBlue, 
          clWhite, 
          clGray, 
          clFuchsia, 
          clTeal, 
          clNavy, 
          clMaroon 
          ); 

procedure TForm1.FormCreate(Sender: TObject); 
var i,c : integer; 
begin 
c:= 0; 
for i := 0 to 19 do 
begin 
  if i mod 10= 0 then c:= 1 
  else c:= c+1; 
  Series1.AddXY(i,random(10),'',ColorP[c]); 
end; 
end;  
or if you are a source code customer modify the Array of colors and recompile the sources.