Problem with legend of Palette

TeeChart VCL for Borland/CodeGear/Embarcadero RAD Studio, Delphi and C++ Builder.
Post Reply
Elisabet
Newbie
Newbie
Posts: 22
Joined: Fri Nov 15, 2002 12:00 am
Location: Madrid

Problem with legend of Palette

Post by Elisabet » Thu Jan 26, 2006 1:44 pm

Hello,

I’ve used the Default Palette of type Pale and the Legend is not the correspondent with the colors used in the draw. The first orange color (Series1->Palette[0].Color) is duplicated in the legend and the last color (Series1->Palette[maxIndex].Color) is not shown in the legend. I want to assign the correct colors by the function:

void __fastcall TFormWorldMapLogarithmic::Chart1GetLegendText(
TCustomAxisPanel *Sender, TLegendStyle LegendStyle, int Index,
AnsiString &LegendText)
{
Series1->LegendItemColor(Index) = Series1->Palette[Index].Color;
}

But I have a error while I compile it.

What could I do?

Thanks in advance,

Elisabet

Pep
Site Admin
Site Admin
Posts: 3295
Joined: Fri Nov 14, 2003 5:00 am
Contact:

Post by Pep » Mon Jan 30, 2006 9:57 am

Hi Elisabet,

yes, LegendItemColor is a function and does not accept a color. How can I reproduce the problem ?
In case you are using the same palette steps as values in the series you can use the following code to assign the colors :

Code: Select all

for i:= 0 to Series1.Count-1 do
Series1.ValueColor[i]:=Series1.Palette[i].Color;

IAS
Newbie
Newbie
Posts: 1
Joined: Fri Nov 15, 2002 12:00 am

Post by IAS » Thu Apr 06, 2006 3:59 pm

I also have this problem but it is with a single TSurfaceSeries so the solution does not apply.

To elaborate, the surface plot renders fine with all the palette colours I define using AddPalette() but the legend colours miss the lowest palette value and double up on the highest palette value. The order in which the values are added to the palette does not change the results. LegendItemColor() confirms that the top two colors are the same and the expected bottom color is missing.

I am using TeeChart Pro 5.03

Post Reply