How to use the SeriesDefinition SeriesStyle

3 posts, 0 answers
  1. Cedric
    Cedric avatar
    64 posts
    Member since:
    Oct 2010

    Posted 01 Aug 2011 Link to this post

    Hi,

    I'm trying to use the SeriesStyle property of the StackedSeriesDefinition to set  several properties for a lot graph but i get an XamlParseError :
    Set property 'System.Windows.Style.TargetType' threw an exception
    "'HorizontalStackedBarSeriesDefinition' type must derive from FrameworkElement or FrameworkContentElement."

    Here is the xaml
    <telerik:RadChart x:Name="chart7" ItemsSource="{Binding SampleData2}">
        <telerik:RadChart.SeriesMappings>
            <telerik:SeriesMapping LegendLabel="SUCCESS" CollectionIndex="0">
                <telerik:SeriesMapping.SeriesDefinition>
                    <telerik:StackedBarSeriesDefinition SeriesItemLabelStyle="{StaticResource CustomSerieItemchart7}" SeriesStyle="{StaticResource MinimizedStackedBarSeriesDefinitionStyle}" />
                </telerik:SeriesMapping.SeriesDefinition>
    ....
    <Style x:Uid="Style_26"
            x:Key="MinimizedStackedBarSeriesDefinitionStyle"
            TargetType="{x:Type telerik:HorizontalStackedBarSeriesDefinition}">
        <Setter x:Uid="Setter_216"
                Property="ShowItemLabels"
                Value="false" />
        <Setter x:Uid="Setter_217"
                Property="LabelSettings">
            <Setter.Value>
                <telerik:BarLabelSettings x:Uid="telerik:BarLabelSettings_1"
                                            LabelDisplayMode="Outside"
                                            ShowConnectors="False" />
            </Setter.Value>
        </Setter>
    </Style>


    Am i using the wrong property ?
    Thanks
    - Cedric -
  2. Cedric
    Cedric avatar
    64 posts
    Member since:
    Oct 2010

    Posted 01 Aug 2011 Link to this post

    I have the same error with this style
    <Style x:Key="MinimizedAxisStyle"
              x:Uid="Style_27"
              TargetType="{x:Type telerik:Axis}">
           <Setter x:Uid="Setter_218"
                   Property="Title"
                   Value="" />
           <Setter x:Uid="Setter_219"
                   Property="AxisLabelsVisibility"
                   Value="Collapsed" />
           <Setter x:Uid="Setter_220"
                   Property="MajorTicksVisibility"
                   Value="Collapsed" />
           <Setter x:Uid="Setter_221"
                   Property="MinorTicksVisibility"
                   Value="Collapsed" />
       </Style>
  3. Sia
    Admin
    Sia avatar
    682 posts

    Posted 03 Aug 2011 Link to this post

    Hello Cedric,

    You need to use ItemStyle in your case. Customizing a series should be done by setting the SeriesDefinition.ItemStyle property for item-drawn series or the SeriesDefinition.SeriesStyle property for self-drawn series. More information about this topic is available here.

    Regards,
    Sia
    the Telerik team

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

Back to Top