Page 1 of 1

Color Scale for TColorGridSeries

Posted: Thu Oct 20, 2005 3:38 pm
by 8572663
I am displaying pixel images on a TColorGridSeries. I would like to be able to change the color scale for the Y axis. I am able to assign colors to specific Y values using the AddPalette method (UsePalette). I am also able to set the start, mid and end colors (UseColorRange) successfully.

You also have some predefined color schemes. Is there a way for me to define my own color scheme?

Thanks in advance!

Posted: Fri Oct 21, 2005 8:58 am
by narcis
Hi leaf,

You can 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;