colourgrid palette

TeeChart VCL for Borland/CodeGear/Embarcadero RAD Studio, Delphi and C++ Builder.
Post Reply
sean
Newbie
Newbie
Posts: 11
Joined: Fri Jan 30, 2004 5:00 am
Location: uk
Contact:

colourgrid palette

Post by sean » Wed Jun 09, 2004 12:22 am

I have a tcolourgrid, not 3D mode, x is 1 to 15, z is 1 to 300, y varies between 2.0 and 12.0. I'd like to assign my own colour palette to values of y in bands - col1=2.0 to 3.0, col2=3.0 to 4.0 etc. Can someone give me an oindication how to do this please, user needs to be able to edit the palette and apply updated colours to the grid.

cheers
Sean.

Marjan
Site Admin
Site Admin
Posts: 745
Joined: Fri Nov 07, 2003 5:00 am
Location: Slovenia
Contact:

Post by Marjan » Wed Jun 09, 2004 5:55 am

Hi, Sean.

Yes, this can be done by adding custom palette levels to internal palette color array. There is an example of this (for NET version, but the same approach can be used in VCL) available here.
Marjan Slatinek,
http://www.steema.com

sean
Newbie
Newbie
Posts: 11
Joined: Fri Jan 30, 2004 5:00 am
Location: uk
Contact:

Post by sean » Wed Jun 09, 2004 12:25 pm

cheers Marjan,

that did the trick once ported to Delphi, just need to add a way for user to customize the palette now.
thanks,
Sean.

sean
Newbie
Newbie
Posts: 11
Joined: Fri Jan 30, 2004 5:00 am
Location: uk
Contact:

Post by sean » Thu Jun 10, 2004 12:41 am

Is there a bug in the way this is handled?

The last two colours of the palette always take on the same colour for me. Try this

series1.PaletteSteps:=7;
series1.ClearPalette();
series1.AddPalette(4,Clnavy);
series1.AddPalette(5,Clblue);
series1.AddPalette(6,Claqua);
series1.AddPalette(7,Clyellow);
series1.AddPalette(8,Cllime);
series1.AddPalette(9,Clgreen);
series1.AddPalette(10,Clred);
series1.UseColorRange:=false;
series1.UsePalette:=true;
Chart1.Refresh();

the palette in the legend gets shunted along 1 position, ie clnavy never gets displayed and clred gets displayed twice. So I try forcing
series1.palette[6].color:=clwhite. 0/1 array indexing problem?

and get same thing, clwhite displayed twice.??

cheers
Sean.

Post Reply