Rotate series item label?

3 posts, 0 answers
  1. Enill
    Enill avatar
    41 posts
    Member since:
    Apr 2010

    Posted 01 Jun 2010 Link to this post

    Hi,
    is there a way to rotate the item label text of a point in a line in code behind? (using a style or api?)

    Currently it look like this "i t e m   l a b e l".

    I would like to have it look like this for exemple:
    "
    l
    e
    b
    a
    l

    m
    e
    t
    i
    "

    Thanks in advance!
  2. Velin
    Admin
    Velin avatar
    391 posts

    Posted 04 Jun 2010 Link to this post

    Hi Enill,

    You can re-style the SeriesItemLabel control as shown in this example. Moreover, you can wrap the border element around a  LayoutTransformControl. Attached is a working example.

    Hope this will help.

    Best wishes,
    Velin
    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.
  3. Enill
    Enill avatar
    41 posts
    Member since:
    Apr 2010

    Posted 04 Jun 2010 Link to this post

    Thanks for the reply.

    One thing thought, i can't use XAML in the code im working on so how do you translate the code below in C#? :

       <ControlTemplate TargetType="chart:SeriesItemLabel"
                                <Canvas> 
                                    <controls:LayoutTransformControl> 
                                        <controls:LayoutTransformControl.Content> 
                                            <Border x:Name="PART_TextContainer" 
                                        Canvas.Left="{TemplateBinding TextContainerCanvasLeft}" 
                                        Canvas.Top="{TemplateBinding TextContainerCanvasTop}" 
                                        Style="{TemplateBinding LabelStyle}" 
                                        BorderBrush="{TemplateBinding Stroke}" 
                                        Background="Transparent"
                                                <TextBlock TextAlignment="{TemplateBinding HorizontalContentAlignment}" 
                                               Margin="{TemplateBinding Padding}" 
                                               Text="{TemplateBinding Content}" /> 
                                            </Border> 
                                        </controls:LayoutTransformControl.Content> 
                                        <controls:LayoutTransformControl.LayoutTransform> 
                                            <RotateTransform Angle="-90" /> 
                                        </controls:LayoutTransformControl.LayoutTransform> 
                                    </controls:LayoutTransformControl> 
                                </Canvas> 
                            </ControlTemplate> 



Back to Top