Page 1 of 1

ColorGrid Question - 2

Posted: Fri Feb 18, 2005 4:19 pm
by 9336985
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

Posted: Tue Mar 01, 2005 11:34 am
by Pep
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;

Posted: Tue Aug 09, 2005 4:38 pm
by 8572663
Does this code work for ColorGridSeries? I am trying to do a similar thing and can not get it to change the legend.

Posted: Thu Aug 11, 2005 4:00 pm
by Pep
Hi,

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

Posted: Wed Aug 17, 2005 2:31 pm
by 8572663
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.

Posted: Thu Sep 01, 2005 4:41 pm
by Pep
Hi,

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