ColorGrid Question - 2

TeeChart VCL for Borland/CodeGear/Embarcadero RAD Studio, Delphi and C++ Builder.
Post Reply
RSpence
Newbie
Newbie
Posts: 33
Joined: Fri Apr 02, 2004 5:00 am
Location: UK / Florida
Contact:

ColorGrid Question - 2

Post by RSpence » Fri Feb 18, 2005 4:19 pm

In an earlier thread I mentioned this code was failing:

series1.Clear;
series1.ClearPalette();
series1.UseColorRange:=false;
series1.UsePalette:=true;

series1.PaletteSteps:=10;
series1.UsePaletteMin := false;
series1.PaletteStep := 100;
series1.PaletteMin := 0;

// For testing - in practice these will all be diff.
series1.AddPalette(100,ClAqua);
series1.AddPalette(200,ClAqua);
series1.AddPalette(300,ClAqua);
series1.AddPalette(400,ClAqua);
series1.AddPalette(500,ClAqua);
series1.AddPalette(600,Clred);
series1.AddPalette(700,Clred);
series1.AddPalette(800,Clred);
series1.AddPalette(900,Clred);
series1.AddPalette(1000, clRed);

y := 0;
for z := 0 to 60 do
for x := 0 to 85 do
begin
series1.AddXYZ(x, y, z);
y := (y + 1) mod 1001 ;
end;

I updated to 7.04 - and I have exactly the same trouble. However, if I remove these four lines:

series1.PaletteSteps:=10;
series1.UsePaletteMin := false;
series1.PaletteStep := 100;
series1.PaletteMin := 0;

as I just discovered it seems to work. I don't know why this would make a difference as AFAICT these are the same values that are set at design time - any ideas?

Regards,

Rick

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

Post by Pep » Tue Mar 01, 2005 11:34 am

Hi Rick,

the correct code should be :

Code: Select all

procedure TForm1.FormCreate(Sender: TObject);
var y,z,x : integer;
begin
series1.Clear;
series1.UsePalette:=true;
series1.UseColorRange:=false;
series1.ClearPalette();

// For testing - in practice these will all be diff.
series1.AddPalette(100,ClAqua);
series1.AddPalette(200,ClAqua);
series1.AddPalette(300,ClAqua);
series1.AddPalette(400,ClAqua);
series1.AddPalette(500,ClAqua);
series1.AddPalette(600,Clred);
series1.AddPalette(700,Clred);
series1.AddPalette(800,Clred);
series1.AddPalette(900,Clred);
series1.AddPalette(1000, clRed);

y := 0;
for z := 0 to 60 do
for x := 0 to 85 do
begin
series1.AddXYZ(x, y, z);
y := (y + 1) mod 1001 ;
end;

leaf
Newbie
Newbie
Posts: 37
Joined: Fri Nov 15, 2002 12:00 am

Post by leaf » Tue Aug 09, 2005 4:38 pm

Does this code work for ColorGridSeries? I am trying to do a similar thing and can not get it to change the legend.

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

Post by Pep » Thu Aug 11, 2005 4:00 pm

Hi,

yes, test it here and works fine (using the latest TeeChart Pro v7.04).

leaf
Newbie
Newbie
Posts: 37
Joined: Fri Nov 15, 2002 12:00 am

Post by leaf » Wed Aug 17, 2005 2:31 pm

Yes, I found the issue. When you call ClearPalette, it does more than clear the color pallet. If you step down into the code you will see that it clears ALL settings related to the TColorGridSeries.

I think this should be a bug. It is clearing more than the color palette. When this is called, you must than reset all parameters for this chart. This means that in my realtime imaging application, I have to reinitialize all chart parameters in time critical routines if i want to change the color palette.

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

Post by Pep » Thu Sep 01, 2005 4:41 pm

Hi,

ok, we'll review this in order to see what can we do.

Post Reply