Lots and lots of bar colours

TeeChart VCL for Borland/CodeGear/Embarcadero RAD Studio, Delphi and C++ Builder.
Post Reply
Mortong
Newbie
Newbie
Posts: 15
Joined: Mon Mar 29, 2004 5:00 am
Location: london

Lots and lots of bar colours

Post by Mortong » Mon Apr 19, 2004 2:04 pm

Good afternnon

Thank y'a;; for your pervious help.

If I have say 150 bars then the colours seem to fizzle out after say 15, can I reuse the same sequence so it looks pretty as opposed to red,green, blue, cyan, orange,orange,orange,orange,orange....

Morton

D7, Teechart 7

Pep
Site Admin
Site Admin
Posts: 3299
Joined: Fri Nov 14, 2003 5:00 am
Contact:

Post by Pep » Mon Apr 19, 2004 3:13 pm

Hi Morton,

I guess the only way to change this is to change source code and recompile TC packages (if you are source code customer). Or create your
custome array of colors.

Mortong
Newbie
Newbie
Posts: 15
Joined: Mon Mar 29, 2004 5:00 am
Location: london

Post by Mortong » Tue Apr 20, 2004 5:03 pm

Erm, like how please....

Pep
Site Admin
Site Admin
Posts: 3299
Joined: Fri Nov 14, 2003 5:00 am
Contact:

Post by Pep » Tue Apr 20, 2004 6:40 pm

Hi Morton,

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;

AMS
Newbie
Newbie
Posts: 24
Joined: Wed Mar 31, 2004 5:00 am
Location: South Africa
Contact:

Using Custom Palette

Post by AMS » Thu Sep 22, 2005 11:43 am

Hi Josep,
Instead of using an array of colours, would it not be better to use the custom palette method? Could you please give an exmple using TChartSeries (Bar or something) with custom palette?

Regards john.

Pep
Site Admin
Site Admin
Posts: 3299
Joined: Fri Nov 14, 2003 5:00 am
Contact:

Post by Pep » Mon Sep 26, 2005 8:19 am

Hi john,

in TeeChart v6 and above the ColorPalette is declared as
var ColorPalette:Array of TColor;

so you can simply access/change color palette without need to recompile TeeChart sources.

Post Reply