Custom palette

4 posts, 0 answers
  1. Tim
    Tim avatar
    114 posts
    Member since:
    Aug 2011

    Posted 09 Aug 2012 Link to this post

    Hello telerik!

    How can I use a custom palette with RadChartView (PieChart)? With RadChart it was possible to use a BrushCollection. How can that be achieved with RadChartView?

    Thanks a lot!
    Tim.
  2. Tim
    Tim avatar
    114 posts
    Member since:
    Aug 2011

    Posted 09 Aug 2012 Link to this post

    Ok. I think I got it. Currently I am using this code here:
    public ChartPalette Palette2
    {
        get
        {
            if (_palette2 == null)
            {
                _palette2 = new ChartPalette();
                PaletteEntryCollection collection = new PaletteEntryCollection();
                foreach (var color in MyColors)
                {
                    PaletteEntry pe = new PaletteEntry(color);
                    collection.Add(pe);
                    _palette2.GlobalEntries.Add(pe);
                }
     
                _palette2.SeriesEntries.Add(collection);
            }
     
            return _palette2;
        }
    }

    The binding:
    <telerik:RadPieChart Palette="{Binding Palette2}">

    Thanks,
    Tim.


  3. DevCraft banner
  4. Sia
    Admin
    Sia avatar
    667 posts

    Posted 13 Aug 2012 Link to this post

    Hello Tim,

    I am happy to hear that you managed to solve your problem. However this forum post also could be of interest to you.

    Regards,
    Sia
    the Telerik team

    Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

  5. Tim
    Tim avatar
    114 posts
    Member since:
    Aug 2011

    Posted 13 Aug 2012 Link to this post

    Hi Sia,

    thanks! I'll have a look at it!
    Tim.
Back to Top