Articles in this section
Category / Section

How to show all the axis labels?

1 min read

By default, the axis labels that are intersected with each other will be hidden. SfChart has options to make all the labels visible and position the collided labels smartly. You can either place the intersecting labels in multiple rows or rotate all the labels to fix in available position.

The following code snippet and screenshot demonstrate how to place the collided labels in multiple rows by setting the LabelsIntersectAction property to MultipleRows.

XAML:

<chart:SfChart.PrimaryAxis>
         <chart:CategoryAxis LabelsIntersectAction="MultipleRows" >
         </chart:CategoryAxis>                 
 </chart:SfChart.PrimaryAxis>
…

 

C#:   

SfChart chart = new SfChart();
 
CategoryAxis primaryAxis = new CategoryAxis();
chart.PrimaryAxis = primaryAxis;
primaryAxis.LabelsIntersectAction = AxisLabelsIntersectAction.MultipleRows;
…

 

Screenshot:

C:\Users\manojkiran.sudhakar\AppData\Local\Microsoft\Windows\INetCache\Content.Word\Screenshot_2017-12-21-10-43-02-707.jpeg

 

Alternatively, we have also an another option to rotate all the labels to avoid collision. Please refer the following code snippet and screenshot.

XAML:

<chart:SfChart.PrimaryAxis>
         <chart:CategoryAxis LabelRotationAngle="-45">
         </chart:CategoryAxis>                 
 </chart:SfChart.PrimaryAxis>
…

 

C#:

SfChart chart = new SfChart();
 
CategoryAxis primaryAxis = new CategoryAxis();
chart.PrimaryAxis = primaryAxis;
primaryAxis.LabelRotationAngle=-45;
…

 

Screenshot:

C:\Users\manojkiran.sudhakar\AppData\Local\Microsoft\Windows\INetCache\Content.Word\Screenshot_2017-12-21-10-40-58-780.jpeg

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