Andi
asked on 24 Jun 2021, 01:10 PM
| edited on 24 Jun 2021, 01:11 PM
Hi there,
i found an old post where some one asked to rotate the series labels via XAML and C# code behind. Is this possible and can you show me an example how to do this in an RadCartesianChart.
I have to do it via code behind...
TIA, Andi
1 Answer, 1 is accepted
1
Accepted
Martin Ivanov
Telerik team
answered on 28 Jun 2021, 07:06 AM
Hello Andreas,
There is no explicit API for label rotation, but the series labels are fully customizable so you can easily achieve your requirement. To do so, you can define a LabelDefinition for the chart series and then define a DataTemplate that you can assign to the Template property of the definition. This way you can add a TextBlock and set its LayoutTransform to a RotateTransform.
Alternatively, you can use the DefaultVisualStyle, instead of the Template of the label definition in order to apply the transformation. This is going to be a bit easier to adjust in code-behind. In case you want to stick to the Template approach, you can take a look at the Using DataTemplate in Code article.
I hope that helps.
Regards,
Martin Ivanov
Progress Telerik
Virtual Classroom, the free self-paced technical training that gets you up to speed with Telerik and Kendo UI products quickly just got a fresh new look + new and improved content including a brand new Blazor course! Check it out at https://learn.telerik.com/.