Color Scale for TColorGridSeries

TeeChart VCL for Borland/CodeGear/Embarcadero RAD Studio, Delphi and C++ Builder.
Post Reply
leaf
Newbie
Newbie
Posts: 37
Joined: Fri Nov 15, 2002 12:00 am

Color Scale for TColorGridSeries

Post by leaf » Thu Oct 20, 2005 3:38 pm

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!

Narcís
Site Admin
Site Admin
Posts: 14730
Joined: Mon Jun 09, 2003 4:00 am
Location: Banyoles, Catalonia
Contact:

Post by Narcís » Fri Oct 21, 2005 8:58 am

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; 
Best Regards,
Narcís Calvet / Development & Support
Steema Software
Avinguda Montilivi 33, 17003 Girona, Catalonia
Tel: 34 972 218 797
http://www.steema.com
Image Image Image Image Image Image
Instructions - How to post in this forum

Post Reply