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
ColorGrid Question - 2
Hi Rick,
the correct code should be :
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;
Pep Jorge
http://support.steema.com
http://support.steema.com
Hi,
yes, test it here and works fine (using the latest TeeChart Pro v7.04).
yes, test it here and works fine (using the latest TeeChart Pro v7.04).
Pep Jorge
http://support.steema.com
http://support.steema.com
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.
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.