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

Bar series style BasedOn missing

1 Answer 127 Views
ChartView
This is a migrated thread and some comments may be shown as answers.
Jan Białokozowicz
Top achievements
Rank 1
Jan Białokozowicz asked on 06 Nov 2013, 01:25 PM
Im using RadChartView integrated with RadPivotGrid. 

In your samples you have code:
<Style TargetType="telerik:BarSeries" x:Key="barCategoricalSeriesDescriptorStyle" BasedOn="{StaticResource BarSeriesStyle}">
    <Setter Property="CombineMode" Value="{Binding ElementName=CombineMode, Path=SelectedItem}"/>
    <Setter Property="LegendSettings" Value="{Binding Name, Converter={StaticResource SeriesSourceNameToSeriesLegendSettigsConverter}}"/>
</Style>
 
<Style TargetType="telerik:AreaSeries" x:Key="areaCategoricalSeriesDescriptorStyle" BasedOn="{StaticResource AreaSeriesStyle}">
    <Setter Property="CombineMode" Value="{Binding ElementName=CombineMode, Path=SelectedItem}"/>
    <Setter Property="LegendSettings" Value="{Binding Name, Converter={StaticResource SeriesSourceNameToSeriesLegendSettigsConverter}}"/>
</Style>
 
<Style TargetType="telerik:LineSeries" x:Key="lineCategoricalSeriesDescriptorStyle" BasedOn="{StaticResource LineSeriesStyle}">
    <Setter Property="CombineMode" Value="{Binding ElementName=CombineMode, Path=SelectedItem}"/>
    <Setter Property="LegendSettings" Value="{Binding Name, Converter={StaticResource SeriesSourceNameToSeriesLegendSettigsConverter}}"/>
</Style>

I have problem with
BasedOn="{StaticResource BarSeriesStyle}"

BarSeriesStyle is not found. 
My question is where to find this style.

1 Answer, 1 is accepted

Sort by
0
Evgenia
Telerik team
answered on 11 Nov 2013, 12:57 PM
Hello Jan,

I prepared a sample project based on your code snippet and everything is working as expected on my side - the BarSeriesStyle gets applied. You may find my test project attached below.
Some notes about it and BarSeriesStyle:
To be able to base on BarSeriesStyle you should ensure that you use our Implicit Style mechanism. Every series has a style formed by the name of the series type followed by a “Style” suffix. For example, for the BarSeries there is a default style with x:Key=”BarSeriesStyle” (located in Telerik.Windows.Controls.Chart.xaml file). Most probably the reason for your exception is that you missed to merge this resource in your App.xaml file:
<Application.Resources>
      <ResourceDictionary>
          <ResourceDictionary.MergedDictionaries>
              <ResourceDictionary Source="Themes/Telerik.Windows.Controls.xaml" />
              <ResourceDictionary Source="Themes/Telerik.Windows.Controls.Chart.xaml" />
          </ResourceDictionary.MergedDictionaries>
      </ResourceDictionary>
  </Application.Resources>

or

<Application.Resources>
      <ResourceDictionary>
          <ResourceDictionary.MergedDictionaries>
              <ResourceDictionary Source="/Telerik.Windows.Themes.Windows8/;component/Themes/Telerik.Windows.Controls.xaml" />
              <ResourceDictionary Source="/Telerik.Windows.Themes.Windows8/;component/Themes/Telerik.Windows.Controls.Chart.xaml" />
          </ResourceDictionary.MergedDictionaries>
      </ResourceDictionary>
  </Application.Resources>


Could you try to reproduce the problem in the project sent or attach us your runnable one where the error reproduces?

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 >>
Tags
ChartView
Asked by
Jan Białokozowicz
Top achievements
Rank 1
Answers by
Evgenia
Telerik team
Share this question
or