Articles in this section
Category / Section

How to rotate text in adornment of WPF Chart (SfChart)?

1 min read

You can roatate the text in an adornment by overriding the adornment’s LabelTemplate property in ChartAdornmentInfo of ColumnSeries in WPF Chart (SfChart) and applying the RenderTransform for the TextBlock as shown in the following code example.

XAML

<Syncfusion:ColumnSeries.AdornmentsInfo>
    <Syncfusion:ChartAdornmentInfo  ShowLabel="True" AdornmentsPosition="Top" >
         <Syncfusion:ChartAdornmentInfo.LabelTemplate>
              <DataTemplate>
                   <!--LabelTemplate for Rotating Text in Adornment-->
                   <TextBlock Foreground="DarkSlateGray" FontSize="25"   FontWeight="Bold" Text="{Binding}" RenderTransformOrigin="0.5,0.5">
                        <TextBlock.RenderTransform>
                             <RotateTransform Angle="45"></RotateTransform>
                        </TextBlock.RenderTransform>
                   </TextBlock>
              </DataTemplate>
         </Syncfusion:ChartAdornmentInfo.LabelTemplate>
    </Syncfusion:ChartAdornmentInfo>
</Syncfusion:ColumnSeries.AdornmentsInfo>

 

WPF Chart displays Text Rotation in Adornment

 

Did you find this information helpful?
Yes
No
Help us improve this page
Please provide feedback or comments
Comments (0)
Please sign in to leave a comment
Access denied
Access denied