Bar series style BasedOn missing

2 posts, 0 answers
  1. Jan Białokozowicz
    Jan Białokozowicz avatar
    7 posts
    Member since:
    Jan 2010

    Posted 06 Nov 2013 Link to this post

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

    Posted 11 Nov 2013 Link to this post

    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 >>
  3. DevCraft banner
Back to Top