Siva,

I think you haven't looked at the code in detail.
There is a for loop in which the Pie item are created and add. In
that , they are assigning a color to each pie item.

If you want to have your own range of colors , you may need to assign
a color to item.Color attribute  when the loop execute each time.  may
me something like this,,,,,

for (int i = 0; i < MaxPieItems ; i++) {
                ItemCount  = mNumGen.nextInt(256);
                Item       = new PieDetailsItem();
                Item.Count = ItemCount;
                Item.Label = "Valeur " + mNumGen.nextInt(1000);
                //Item.Color = 0xff000000 + 256*256*mNumGen.nextInt(256) +
256*mNumGen.nextInt(256) + mNumGen.nextInt(256);
                switch(i){
                case 0:
                 Item.Color = 0xffff0000;
                 break;
                case 1:
                        Item.Color = 0xff00ff00;
                        break;
                case 2:
                        default:
                                Item.Color = 0xffffff00;
                                break;
                }
                PieData.add(Item);
                MaxCount += ItemCount;
        }


On Apr 18, 11:28 pm, Siva Kannabiran <sivasanka...@gmail.com> wrote:
> The following is the original code line
> Item.Color = 0xff000000 +256*256*mNumGen.nextInt(256) +
> 256*mNumGen.nextInt(256) + mNumGen.nextInt(256);
>
> for this line the output will be as the attached file image1.png.
>
> Now i am trying to change the colors to be as green, blue and red. I am not
> able change it.
>
> On Mon, Apr 18, 2011 at 11:34 PM, TreKing <treking...@gmail.com> wrote:
> > On Mon, Apr 18, 2011 at 12:57 PM, Siva Kannabiran 
> > <sivasanka...@gmail.com>wrote:
>
> >> The colors which i need are green blue and red
>
> > Wait ... are you expecting to set *one* color attribute to 3 different
> > colors at the same time?
>
> > -------------------------------------------------------------------------------------------------
> > TreKing <http://sites.google.com/site/rezmobileapps/treking> - Chicago
> > transit tracking app for Android-powered devices
>
> >  --
> > You received this message because you are subscribed to the Google
> > Groups "Android Developers" group.
> > To post to this group, send email to android-developers@googlegroups.com
> > To unsubscribe from this group, send email to
> > android-developers+unsubscr...@googlegroups.com
> > For more options, visit this group at
> >http://groups.google.com/group/android-developers?hl=en
>
> --
> Siva Shankar K
>
>  image1.png
> 9KViewDownload

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Reply via email to