PieChart colors

TeeChart VCL for Borland/CodeGear/Embarcadero RAD Studio, Delphi and C++ Builder.
Post Reply
Nati
Newbie
Newbie
Posts: 5
Joined: Mon Dec 27, 2004 5:00 am

PieChart colors

Post by Nati » Sun Jan 23, 2005 3:04 pm

hi

im using a chart which can be pie or line or bar
for line, i can change the series.color in order to set the color
i know that i can change the series.valuecolor[idx] for pie
but when can i know all the value number of the pie and change each and every one of them?

i tried:
for i := 0 to series.valuelist.count - 1 do
series.valuecolor := clColor;

but in the count i got 2. while there were much more than 2
what am i missing?
thanks

Marjan
Site Admin
Site Admin
Posts: 745
Joined: Fri Nov 07, 2003 5:00 am
Location: Slovenia
Contact:

Post by Marjan » Sun Jan 23, 2005 3:48 pm

Hi.

The Valuelist.Count returns number of different valuelists (not points) in series. For pie series, this is 2 (XValues, Yvalues). To get the number of points (pies), you have to use slightly different code:

Code: Select all

for i := 0 to pieSeries1.Count - 1 do
  pieSeries.ValueColor[i] := yourcolor comes here
Marjan Slatinek,
http://www.steema.com

Nati
Newbie
Newbie
Posts: 5
Joined: Mon Dec 27, 2004 5:00 am

Post by Nati » Mon Jan 24, 2005 7:09 am

this is the code:
for x := 0 to Series.Count - 1 do
case x of
0: Series.ValueColor[x] := ColorSchema.GraphSeries1_Color;
1: Series.ValueColor[x] := ColorSchema.GraphSeries2_Color;
2: Series.ValueColor[x] := ColorSchema.GraphSeries3_Color;
3: Series.ValueColor[x] := ColorSchema.GraphSeries4_Color;
4: Series.ValueColor[x] := ColorSchema.GraphSeries5_Color;
5: Series.ValueColor[x] := ColorSchema.GraphSeries6_Color;
6: Series.ValueColor[x] := ColorSchema.GraphSeries7_Color;
7: Series.ValueColor[x] := ColorSchema.GraphSeries8_Color;
8: Series.ValueColor[x] := ColorSchema.GraphSeries9_Color;
9: Series.ValueColor[x] := ColorSchema.GraphSeries10_Color;
end;
end;

but its not affecting the pie colors

Pep
Site Admin
Site Admin
Posts: 3303
Joined: Fri Nov 14, 2003 5:00 am
Contact:

Post by Pep » Tue Jan 25, 2005 9:54 am

Hi,

using the following code works fine here (v7.02) :

Code: Select all

procedure TForm1.BitBtn1Click(Sender: TObject);
var x : integer;
begin
for x := 0 to Series1.Count - 1 do
case x of
0: Series1.ValueColor[x] := RGB(255,255,x*20);
1: Series1.ValueColor[x] := RGB(255,255,x*20);
2: Series1.ValueColor[x] := RGB(255,255,x*20);
3: Series1.ValueColor[x] := RGB(255,255,x*20);
4: Series1.ValueColor[x] := RGB(255,255,x*20);
5: Series1.ValueColor[x] := RGB(255,255,x*20);
6: Series1.ValueColor[x] := RGB(255,255,x*20);
7: Series1.ValueColor[x] := RGB(255,255,x*20);
8: Series1.ValueColor[x] := RGB(255,255,x*20);
9: Series1.ValueColor[x] := RGB(255,255,x*20);
end;
end;
If you still having problems could you please post an example into the news://steema.net/steema.public.attachments newsgroup with which I can reproduce the problem "as is" here ?

Post Reply