September 16th, 2012, 12:22 AM
-
Changing TChart legend colour
I have an application which creates a line chart using the TChart component. The default third colour in the pallette is yellow which is difficult to see on a white background.
I changed the colour of the third series to blue using the following:
for i:= 0 to 2 do
with Chart1.Series[i] do
begin
for j := 7 to 106 do
begin
if i <> 2 then AddXY(100-(j-6),StrToFloat(ChartArray[NumberOfRows+i+1,j]),'',)
else
AddXY(100-(j-6),StrToFloat(ChartArray[NumberOfRows+i+1,j]),'',clBlue);
end;
end;
This works for the chart but the colour of the line in the legend is still yellow.
How do I make the legend the same colour as the series?
September 16th, 2012, 05:31 AM
-
I found the solution by adding the line:
Chart1.Series[2].SeriesColor:=clBlue;