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

rotate label on AxisX

2 Answers 47 Views
Chart
This is a migrated thread and some comments may be shown as answers.
Chris
Top achievements
Rank 1
Chris asked on 05 Jun 2009, 06:42 AM

Posted 23 hours ago (permalink)

Hi,
I need to rotate label in code
we using code behind (example in forum) to create a chart. how can i get following done in code behind not sure how  to get to this properties from code:

following works in xamel but need to do from code

<Style TargetType="telerik:AxisXLabel2D"
            <Setter Property="LayoutTransform"
                <Setter.Value> 
                    <RotateTransform Angle="-90"/> 
                </Setter.Value> 
            </Setter> 
        </Style> 

or

 

 

<telerik:LabelFormatConverter

 x:Key="labelFormatConverter" />

 <Style

      targetType="telerik:AxisXLabel2D">

     <Setter

         Property="LayoutTransform">

     <Setter.Value>

        <RotateTransform

             Angle="-90" />

     </Setter.Value>

  </Setter>

 

 


thx

2 Answers, 1 is accepted

Sort by
0
Chris
Top achievements
Rank 1
answered on 05 Jun 2009, 06:44 AM
srry didnt mention we using RadControls for WPF Q1 2009 SP2
0
Ves
Telerik team
answered on 08 Jun 2009, 07:42 AM
Hello Chris,

Here is an example:

Style style = new Style(); 
             
RotateTransform transform = new RotateTransform(); 
transform.Angle = -90; 
Setter setter = new Setter(); 
setter.Property = AxisXLabel2D.LayoutTransformProperty; 
setter.Value = transform; 
 
style.Setters.Add(setter); 
style.TargetType = typeof(AxisXLabel2D); 
     
LayoutRoot.Resources.Add(typeof(AxisXLabel2D), style); 

Hope this helps.

Kind regards,
Ves
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
Tags
Chart
Asked by
Chris
Top achievements
Rank 1
Answers by
Chris
Top achievements
Rank 1
Ves
Telerik team
Share this question
or