#1
  1. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Sep 2012
    Posts
    5
    Rep Power
    0

    Question 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?
  2. #2
  3. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Sep 2012
    Posts
    5
    Rep Power
    0

    Wink


    I found the solution by adding the line:

    Chart1.Series[2].SeriesColor:=clBlue;

IMN logo majestic logo threadwatch logo seochat tools logo