This is a migrated thread and some comments may be shown as answers.

How to set piechart pallete colours using property ?

1 Answer 74 Views
Chart
This is a migrated thread and some comments may be shown as answers.
Saravanan
Top achievements
Rank 1
Saravanan asked on 27 Jul 2011, 01:58 PM
Hi,
i am showing two colors for my rad piechart,for this i wrote code in xaml like this
 
<telerik:RadChart.PaletteBrushes>
           <SolidColorBrush Color= #FF3597CA" />
            <SolidColorBrush Color=" #FF3597CA" />
  </telerik:RadChart.PaletteBrushes>
 
is it possible to have a color using property like this,
 
 <telerik:RadChart.PaletteBrushes>
 
                <SolidColorBrush Color="{Binding Palette}" />
          
        </telerik:RadChart.PaletteBrushes>
 
 
In code behind
 
public BrushCollection Palette
        {
            get
            {
                return this._palette;
            }
            set
            {
                this._palette = value;
            }
        }
 
//Construcotr
public Example()
        {
     
 
            InitializeComponent();
             
                this.Palette = new BrushCollection()
                {
                    new SolidColorBrush(Color.FromArgb(255, 106, 148, 200)),
                    new SolidColorBrush(Color.FromArgb(255, 154, 204, 255)),
              
                  
                };
        }
 
 
but this code is not working..
 
Thank you,
Saravanan

1 Answer, 1 is accepted

Sort by
0
Sia
Telerik team
answered on 29 Jul 2011, 03:57 PM
Hi Saravanan,

You need to bind the PaletteBrushes property as follows:
PaletteBrushes="{Binding Palette}"

Regards,
Sia
the Telerik team

Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get now >>

Tags
Chart
Asked by
Saravanan
Top achievements
Rank 1
Answers by
Sia
Telerik team
Share this question
or