XamPieChart Brushes being chosen randomly?

Not Answered This post has 0 verified answers | 3 Replies | 3 Followers Thread's RSS feed.

casey2727
Points 20
Replied On: Tue, Aug 16 2011 12:19 AM Reply

I'm instantiating multiple XamPieCharts with identical data, and different colors get assigned seemingly at random.  How do I specify that I want a certain value pair assigned to a certain brush in the Brushes collection?  I really need to control the colors ....

Casey

 

  • Post Points: 20

All Replies

Replied On: Fri, Oct 7 2011 9:52 AM Reply

HI Casey,

 You can define the colors of the slices in the Brushes collection.

 Here is a code snippet

<ig:XamPieChart Name="pieChart"
                        Grid.Row="2"
                        ItemsSource="{Binding PieData }"
                        LabelMemberPath="Label"
                        ValueMemberPath="Value"
                        ToolTip="{}{Label}"
                      
                        Legend="{Binding ElementName=Legend}">
            <ig:XamPieChart.Brushes>
                <ig:BrushCollection>
              <SolidColorBrush>Red</SolidColorBrush>
                <SolidColorBrush>Yellow</SolidColorBrush>
                <SolidColorBrush>blue</SolidColorBrush>
                <SolidColorBrush>Green</SolidColorBrush>
                <SolidColorBrush>Orange</SolidColorBrush>
                <SolidColorBrush>Violet</SolidColorBrush>
                </ig:BrushCollection>
            </ig:XamPieChart.Brushe

 Sincerely,
 Matt
 Developer Support Engineer

Sincerely,
 Matt
Developer Support Engineer

  • Post Points: 5
Replied On: Wed, Oct 12 2011 1:01 PM Reply

HI

 Please let me know if you need further assistance regarding this thread.

 Sincerely,
 Matt
 Developer Support Engineer

 

 

Sincerely,
 Matt
Developer Support Engineer

  • Post Points: 20
Rajiv Bansal
Points 255
Replied On: Tue, Mar 18 2014 4:29 AM Reply

Hi Matt,

 

How do i put brushes dynamically through my viewmodel.

 

Regards,

Rajiv

  • Post Points: 5
Page 1 of 1 (4 items) | RSS