rotate label on AxisX

3 posts, 0 answers
  1. Chris
    Chris avatar
    3 posts
    Member since:
    Jun 2009

    Posted 05 Jun 2009 Link to this post

    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. Chris
    Chris avatar
    3 posts
    Member since:
    Jun 2009

    Posted 05 Jun 2009 Link to this post

    srry didnt mention we using RadControls for WPF Q1 2009 SP2
  3. Ves
    Admin
    Ves avatar
    2926 posts

    Posted 08 Jun 2009 Link to this post

    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.
Back to Top