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

Predefined color palette for pie chart

1 Answer 228 Views
Chart
This is a migrated thread and some comments may be shown as answers.
Darren
Top achievements
Rank 1
Darren asked on 19 Oct 2010, 10:53 PM
Hi,
The WinForms RadChart control has a SeriesPalette property that allows us to set the series colors to a predefined color scheme (for instance BabyBlue, Classic, Rainbow, etc.).  I see that the WPF chart allows you to create a custom palette of colors to use for pie charts, but I don't see a way to map the wedge colors to a predefined theme.  Is that possible with the WPF chart?

Many Thanks!

1 Answer, 1 is accepted

Sort by
0
Evgenia
Telerik team
answered on 22 Oct 2010, 08:06 AM
Hi Darren,
 
You can create your own palette in WPF for Pie chart like this:
radChart.DefaultSeriesDefinition = new PieSeriesDefinition();
            radChart.PaletteBrushes.Add(new SolidColorBrush(Colors.Red));
            radChart.PaletteBrushes.Add(new SolidColorBrush(Colors.Yellow));
            radChart.PaletteBrushes.Add(new SolidColorBrush(Color.FromArgb(255, 238, 97, 6)));
            radChart.PaletteBrushes.Add(new SolidColorBrush(Color.FromArgb(255, 1, 240, 6)));
            radChart.PaletteBrushes.Add(new SolidColorBrush(Colors.Blue));
I'm setting 5 custom colors for my 5 Pie slices. You can extend palette with as much colors as you need.

You can find more information about Styling Series via PaletteBrushes here -> http://www.telerik.com/help/silverlight/radchart-styling-and-appearance-styling-chart-series.html

Unfortunately, RadChart for WPF does not support setting built-in palettes by just specifying their name. You should either use a complete theme or the above approach.

All the best,
Evgenia
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
Tags
Chart
Asked by
Darren
Top achievements
Rank 1
Answers by
Evgenia
Telerik team
Share this question
or