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

Stack bar chart flat solid color brush

5 Answers 70 Views
Chart
This is a migrated thread and some comments may be shown as answers.
Andrea
Top achievements
Rank 1
Andrea asked on 09 Jun 2012, 06:47 AM
Hi,

how can I replace default gradient brush of a stack bar chart series with a flat solid color brush like in Metro style?

5 Answers, 1 is accepted

Sort by
0
Lancelot
Top achievements
Rank 1
answered on 11 Jun 2012, 08:16 PM
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,
Lancelot
0
Sia
Telerik team
answered on 12 Jun 2012, 07:36 AM
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">
...
</telerikCharting:BarSeriesDefinition>
and let me know whether this helps.

Kind regards,
Sia
the Telerik team

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

0
Jaseem
Top achievements
Rank 1
answered on 15 Aug 2013, 06:33 PM
Hi,

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
Jas

0
Evgenia
Telerik team
answered on 20 Aug 2013, 07:12 AM
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;

Regards,
Evgenia
Telerik
TRY TELERIK'S NEWEST PRODUCT - EQATEC APPLICATION ANALYTICS for SILVERLIGHT.
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 >>
0
Ashish
Top achievements
Rank 1
answered on 22 Sep 2014, 06:41 AM
Hey Andrea,

The first trick works great. It was so simple to do this magic. Thank you very much...
Tags
Chart
Asked by
Andrea
Top achievements
Rank 1
Answers by
Lancelot
Top achievements
Rank 1
Sia
Telerik team
Jaseem
Top achievements
Rank 1
Evgenia
Telerik team
Ashish
Top achievements
Rank 1
Share this question
or