Page 1 of 1

Problem with legend of Palette

Posted: Thu Jan 26, 2006 1:44 pm
by 8438229
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

Posted: Mon Jan 30, 2006 9:57 am
by Pep
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;

Posted: Thu Apr 06, 2006 3:59 pm
by 5894618
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