Page 1 of 1

Automatic color of line series

Posted: Fri Jul 20, 2007 8:35 am
by 10545543
I have a chart with number of line series up to 25. These series are partitioned into different group.

The problem is that the lines have automaic different colors in the first ~20 series, but they become alway gray colors in the last few line series.

Posted: Mon Jul 23, 2007 3:33 pm
by Pep
Hi Mike,

yes, there's a predefined array of colors as default. In case you want to have more different colors you can always define a custom array of colors to use. It can be done as bellow :

Code: Select all

procedure TForm1.FormCreate(Sender: TObject);
var
   t:integer;
begin
      SetLength(Chart1.ColorPalette,Length(RainbowPalette));
      for t:=0 to Length(RainbowPalette)-1 do
          Chart1.ColorPalette[t]:=RainbowPalette[t];
end; 

Posted: Fri Jul 27, 2007 11:30 am
by 10545543
Thanks, Pep.

I get to know the colorpallete.
using Rainbow pallete, the colors of lines are quite close to each other. Thus, I still use default pallete, and set line.color:=GetDefaultColor(I mod Length(TeeProcs.ColorPalette)), so that color will repeat that in the colorpalette when the number of lines >length of colorpalette. I think there may be a bug with getdefaultcolor.

By the way, I did not receive the notification email.

Mike

Posted: Fri Jul 27, 2007 11:37 am
by 10545543
I just find it is fine to just use
line.color:=GetDefaultColor(I) for ith line. The precedure of getdefaultcolor is fine.

Mike

Posted: Fri Jul 27, 2007 4:14 pm
by Pep
Hi Mike,

ok, yes you're correct, it's a bug (added on our bug list), once it arrives to 20 it should start again with the first color in the list.
I'm glad to hear you find the workaround.