chart area series color

4 posts, 1 answers
  1. Manish Kumar
    Manish  Kumar avatar
    62 posts
    Member since:
    Feb 2010

    Posted 21 Oct 2010 Link to this post

    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
  2. Answer
    Evgenia
    Admin
    Evgenia avatar
    1437 posts

    Posted 22 Oct 2010 Link to this post

    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
  3. Manish Kumar
    Manish  Kumar avatar
    62 posts
    Member since:
    Feb 2010

    Posted 22 Oct 2010 Link to this post

    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
  4. Evgenia
    Admin
    Evgenia avatar
    1437 posts

    Posted 26 Oct 2010 Link to this post

    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
Back to Top