Silverlight Bar Chart Data Series

2 posts, 0 answers
  1. Manishkumar
    Manishkumar avatar
    240 posts
    Member since:
    Feb 2009

    Posted 21 Jun 2011 Link to this post

    Can you Please provide solution for displaying Data points in bar charts in vertical chart counts on the top of the bars overlapping, when the bar heights were fairly close.  can you Please provide the solution to change the text vertical. Please find the attached screen shot for more details.
  2. Evgenia
    Evgenia avatar
    1437 posts

    Posted 24 Jun 2011 Link to this post

    Hello Manishkumar,

    To be able to rotate the Series Items Labels you should retemplate the default Style and wrap the TextBlock around a  LayoutTransformControl.
    The needed style together with the LayoutTransformControl is demonstrated below:

    <Style x:Key="SeriesItemLabelStyle"
               <Setter Property="Padding" Value="2,0" />
               <Setter Property="IsHitTestVisible" Value="False"/>
               <Setter Property="ContentTemplate">
                                   <TextBlock Text="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=Content }" TextAlignment="Center" />
                                   <RotateTransform Angle="-90" />
               <Setter Property="Template" >
                       <ControlTemplate TargetType="telerikCharting:SeriesItemLabel">
                           <Canvas x:Name="PART_MainContainer">
                               <Path Visibility="{TemplateBinding ConnectorVisibility}"
                                 Style="{TemplateBinding ConnectorStyle}"
                                 Stroke="{TemplateBinding Stroke}"
                                 StrokeThickness="{TemplateBinding StrokeThickness}">
                                       <PathGeometry >
                                               <PathFigure x:Name="PART_Connector">
                                                       <PolyLineSegment />
                               <Border x:Name="PART_TextContainer"
                                   Style="{TemplateBinding LabelStyle}"
                                   BorderBrush="{TemplateBinding Stroke}"
                                   Background="{TemplateBinding Fill}"
                                   Width="{TemplateBinding Width}"
                                   Height="{TemplateBinding Height}">
                                   <ContentPresenter Margin="{TemplateBinding Padding}" />

    All the best,
    the Telerik team
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
Back to Top