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;
Colorgird question
Hi.
Which TeeChart version are you using ? Using the latest version and the code below the result is chart with 10 palette entries and two different colors(aqua for values up to 500 and red for values above 500):
Which TeeChart version are you using ? Using the latest version and the code below the result is chart with 10 palette entries and two different colors(aqua for values up to 500 and red for values above 500):
Code: Select all
series1.Clear;
series1.ClearPalette();
series1.UseColorRange:=false;
series1.UsePalette:=true;
// 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);
Marjan Slatinek,
http://www.steema.com
http://www.steema.com
version
Hi Marjan,
Pro V7 for Delphi 7. BPL files dated 3/5/2004 11:07 AM. Guess I'll see if there's an update..
Regards,
RIck
Pro V7 for Delphi 7. BPL files dated 3/5/2004 11:07 AM. Guess I'll see if there's an update..
Regards,
RIck
-
- Site Admin
- Posts: 14730
- Joined: Mon Jun 09, 2003 4:00 am
- Location: Banyoles, Catalonia
- Contact:
Hi Rick,
This week TeeChart Pro v7.04 VCL has been released and is available at our customer download area.
This week TeeChart Pro v7.04 VCL has been released and is available at our customer download area.
Best Regards,
Narcís Calvet / Development & Support Steema Software Avinguda Montilivi 33, 17003 Girona, Catalonia Tel: 34 972 218 797 http://www.steema.com |
Instructions - How to post in this forum |
Still have problem
Hi,
Thanks for support so far. I downloaded the 7.04 version, and I still have the same problem - but I have news.
1. If I use the code I showed previously on a new chart, it works as expected with a minor glitch - I get two entries in the palette for each value between 300 & 900 - just one value for 200 & 1000.
2. If I use the code on a chart which I had previously configured using the editor, and now want to change, it fails in the way I indicated. Obviously, I need to reset . undo something that I configured in the editor. Scratched my head for a while but can't see it?
Thanks in advance,
Rick
Thanks for support so far. I downloaded the 7.04 version, and I still have the same problem - but I have news.
1. If I use the code I showed previously on a new chart, it works as expected with a minor glitch - I get two entries in the palette for each value between 300 & 900 - just one value for 200 & 1000.
2. If I use the code on a chart which I had previously configured using the editor, and now want to change, it fails in the way I indicated. Obviously, I need to reset . undo something that I configured in the editor. Scratched my head for a while but can't see it?
Thanks in advance,
Rick
Start new trread as I didn't get a reply...
New thread started
Hi Rick,
how about doing :
how about doing :
Code: Select all
procedure TForm1.FormCreate(Sender: TObject);
var y,x,z : integer;
begin
Series1.FillSampleValues(5);
series1.Clear;
series1.ClearPalette();
series1.UseColorRange:=false;
series1.UsePalette:=true;
// 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);
series1.PaletteSteps:=10;
series1.UsePaletteMin := false;
series1.PaletteStep := 100;
series1.PaletteMin := 0;
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