chendriksen
chendriksen

Reputation: 1024

Setting Line Colour In TChart

How can I change the colour of a line in a TChart in Delphi at run time? For example, how would I change the colour of:

Chart1.Series[a].

Upvotes: 3

Views: 5943

Answers (1)

Bruce McGee
Bruce McGee

Reputation: 15334

You almost have it. Just set the colour in the series you're interested in.

  Chart1.Series[0].Color := clBlue;

Update:

Colors are just hex constants in Blue, Green, Red order. The predefined list is in Graphics.pas, but you can use any hex value you like. This line also sets the color of the first series to blue:

  Chart1.Series[0].Color := $FF0000;

If you have more than one series defined, you can do something like this:

  Chart1.Series[0].Color := clGreen;
  Chart1.Series[1].Color := clYellow;

Upvotes: 5

Related Questions