Page 1 of 1

PieChart colors

Posted: Sun Jan 23, 2005 3:04 pm
by 9340414
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

Posted: Sun Jan 23, 2005 3:48 pm
by Marjan
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

Posted: Mon Jan 24, 2005 7:09 am
by 9340414
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

Posted: Tue Jan 25, 2005 9:54 am
by Pep
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 ?