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

Rotate series item label?

2 Answers 84 Views
Chart
This is a migrated thread and some comments may be shown as answers.
Enill
Top achievements
Rank 1
Enill asked on 01 Jun 2010, 09:48 PM
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 Answers, 1 is accepted

Sort by
0
Velin
Telerik team
answered on 04 Jun 2010, 04:12 PM
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.
0
Enill
Top achievements
Rank 1
answered on 04 Jun 2010, 08:29 PM
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> 



Tags
Chart
Asked by
Enill
Top achievements
Rank 1
Answers by
Velin
Telerik team
Enill
Top achievements
Rank 1
Share this question
or