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

chart area series color

3 Answers 105 Views
Chart
This is a migrated thread and some comments may be shown as answers.
Manish Kumar
Top achievements
Rank 1
Manish Kumar asked on 21 Oct 2010, 07:38 AM
Hi

  Is there any way to restrict red coloring of series in the chart area from the chart? I donot want to show the red color for the stackedbar series which comes by default after we assign chart data to the chart control. You may look at the snapshot (marked in a rectangle boundary) for the chart where i need some color formatting by restricting red color on one of the stackedbar item.
thanks
Manish

3 Answers, 1 is accepted

Sort by
0
Accepted
Evgenia
Telerik team
answered on 22 Oct 2010, 02:13 PM
Hello Manish,

You can't restrict some default color from appearing but you can change it with your custom one. As I saw from your attached picture your second series are red. By knowing this you can easily apply Green color instead like this:
SeriesMapping sm2 = new SeriesMapping();
            StackedBarSeriesDefinition stackedBarSeries2 = new StackedBarSeriesDefinition();
            stackedBarSeries2.Appearance.Fill = new SolidColorBrush(Colors.Green);
            stackedBarSeries2.StackGroupName = "Stack1";
            sm2.SeriesDefinition = stackedBarSeries2;
The best part of setting series fill color is that the same color will be applied for your Legend item Marker too.

Kind regards,
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
0
Manish Kumar
Top achievements
Rank 1
answered on 22 Oct 2010, 02:45 PM
Hi Evgenia,

Your solution seems to be working but what if i create 20 custom colors for the chart series and at sometimes my number of series become more than 20, will i have to define further more colors in my collection or then chart will pick new colors by itself or will it start the repetition of color. also whats the deference between using Pallete collection and setting Appearance.Fill for series color

thanks
Manish
0
Evgenia
Telerik team
answered on 26 Oct 2010, 01:27 PM
Hello Manish,

When you create N (20 for example) brushes with Palette collection they will be applied to the first N series of your Chart. You should have in mind that the next Series starting from N+1-st will fallback to use the other available resources (the default colors). There is property called PaletteBrushesRepeat which allows you to control whether your brushes should repeat for other series too. You can find more information about this in our help article - http://www.telerik.com/help/silverlight/radchart-styling-and-appearance-styling-chart-series.html.
As for the difference between using Appearance.Fill and Palette collection - when using Fill property you should set this property for every new series you create. Both Appearance.Fill and Palette collection affect the color of Legend Item Marker.

I hope this information is helpful.

Sincerely yours,
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
Manish Kumar
Top achievements
Rank 1
Answers by
Evgenia
Telerik team
Manish Kumar
Top achievements
Rank 1
Share this question
or