Stack bar chart flat solid color brush

6 posts, 0 answers
  1. Andrea
    Andrea avatar
    16 posts
    Member since:
    May 2011

    Posted 09 Jun 2012 Link to this post


    how can I replace default gradient brush of a stack bar chart series with a flat solid color brush like in Metro style?
  2. Lancelot
    Lancelot avatar
    251 posts
    Member since:
    Jul 2012

    Posted 11 Jun 2012 Link to this post

    Hi Andrea,

    You can do one of two things.
    1) The first is the simplest, just change the theme of the chart to metro as demonstrated here in the example application. Notice in the left pane under the description that you can change the whole theme of that chart by assigning one of 9 built in telerik themes. This document will show you several different ways you can set the theme for a RadChart. The same technique can be used for any of the RadControls for Silverlight.

    2) The second thing you can do, which is more difficult and time consuming, is to create a custom style for the chart. This document will explain there is a few different ways you can modify a theme, or create your own style from scratch. If you only want to change the bars, then you are looking to modify the Series style and this document will show you how to do that.

    I hope this helps you, there are many ways to alter the appearance of any of the RadControls. The theming mechanism is the quickest and is my personal favorite.

    Good Luck,
  3. Sia
    Sia avatar
    685 posts

    Posted 12 Jun 2012 Link to this post

    Hello Andrea,

    I suppose that you use our default theme.

    That is why you can try to set the exposed MaskVisibility property to your Bar series definition as follows:

    <telerikCharting:BarSeriesDefinition MaskVisibility="Collapsed">
    and let me know whether this helps.

    Kind regards,
    the Telerik team

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

  4. Jaseem
    Jaseem avatar
    4 posts
    Member since:
    Aug 2013

    Posted 15 Aug 2013 Link to this post


    how can i set the 'MaskVisibility' property  through code?. cannot find the property in code. i am creating BarSeriesDefinition in code dynamically and it is not declared in xaml.

    sample code:

    dim objSeries as new Series()
    objSeries.SeriesDefinition=new BarSeriesDefinition()
    objSeries.SeriesDefinition.MaskVisibility----------------------->>>>>>>>> property not found.

    thank you

  5. Evgenia
    Evgenia avatar
    1437 posts

    Posted 20 Aug 2013 Link to this post

    Hi Andrea,

      The MaskVisibility property is series type dependent and you need to cast your series to HorizontalBarSeriesDefinition for it to be reachable:

    (this.chart.SeriesMappings[0].SeriesDefinition as HorizontalBarSeriesDefinition).MaskVisibility = System.Windows.Visibility.Collapsed;

    Learn what features your users use (or don't use) in your application. Know your audience. Target it better. Develop wisely.
    Sign up for Free application insights >>
  6. Ashish
    Ashish avatar
    1 posts
    Member since:
    Sep 2014

    Posted 22 Sep 2014 in reply to Lancelot Link to this post

    Hey Andrea,

    The first trick works great. It was so simple to do this magic. Thank you very much...
Back to Top