Page 1 of 1

Setting line/bar color same for multiple series

Posted: Mon Feb 13, 2012 7:52 pm
by 16859341
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;

Re: Setting line/bar color same for multiple series

Posted: Tue Feb 14, 2012 10:17 am
by yeray
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;

Re: Setting line/bar color same for multiple series

Posted: Wed Feb 15, 2012 4:54 pm
by 16859341
my bad... what you offered worked perfect... thank you