Setting line/bar color same for multiple series

TeeChart VCL for Borland/CodeGear/Embarcadero RAD Studio, Delphi and C++ Builder.
Post Reply
kevino
Newbie
Newbie
Posts: 6
Joined: Mon May 16, 2011 12:00 am

Setting line/bar color same for multiple series

Post by kevino » Mon Feb 13, 2012 7:52 pm

I have a need to specify the same color for 4 lines or 2 bar series and 2 line series all to the same color. All of my series are added to the chart at runtime. When i try this i get "Black" series lines. Is there a trick to do this?

Currently i have it setting colors automatically, and was trying to get the color assigned from the first of 4 series.
I'm fetching the color like this from the first series added...
myColor := myBarSeries.BarBrush.Color;

then trying to specify the color in the 2, 3 and 4th series added like this...

myLineSeries[l].LinePen.Color := myColor;

Yeray
Site Admin
Site Admin
Posts: 9612
Joined: Tue Dec 05, 2006 12:00 am
Location: Girona, Catalonia
Contact:

Re: Setting line/bar color same for multiple series

Post by Yeray » Tue Feb 14, 2012 10:17 am

Hi kevino,

Have you tried simply using the series' Color property for both retrieve and assign a color to the series?
It would be something like this:

Code: Select all

myColor := myBarSeries[b].Color;

Code: Select all

myLineSeries[l].Color := myColor;
Best Regards,
ImageYeray Alonso
Development & Support
Steema Software
Av. Montilivi 33, 17003 Girona, Catalonia (SP)
Image Image Image Image Image Image Please read our Bug Fixing Policy

kevino
Newbie
Newbie
Posts: 6
Joined: Mon May 16, 2011 12:00 am

Re: Setting line/bar color same for multiple series

Post by kevino » Wed Feb 15, 2012 4:54 pm

my bad... what you offered worked perfect... thank you

Post Reply