Colorgird question
Posted: Wed Feb 16, 2005 4:02 pm
Hi There,
New to T-Chart, and having trouble getting a ColorGrid to work with my own palette. Sure it's something stupid I'm doing but I've been banging my head against a wall for a few hours....
So, I have a TChart component and a TColorGrid series on a form. If I use the design time editor, with one of the standard paletee styles (pale) everything is pretty much working ok. Trying to change the color palette, though, using the code below, is resulting in a legend showing with just one value: 1000, with a color of red. There's obviously some property I need to set...
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;
New to T-Chart, and having trouble getting a ColorGrid to work with my own palette. Sure it's something stupid I'm doing but I've been banging my head against a wall for a few hours....
So, I have a TChart component and a TColorGrid series on a form. If I use the design time editor, with one of the standard paletee styles (pale) everything is pretty much working ok. Trying to change the color palette, though, using the code below, is resulting in a legend showing with just one value: 1000, with a color of red. There's obviously some property I need to set...
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;