Axis Smart Labels
The RadChartView suite supports couple smart mechanisms which control the axis labels generation.
- SmartLabelsMode: If enabled this feature tells the chart to recalculate the actual step of its axis automatically in order to prevent the axis' labels from overlapping one another. The recalculation logic is executed on update of the chart's layout (like resizing).
- IsStepRecalculationOnZoomEnabled: If enabled this feature controls if the axis should recalculate the actual step it uses when the chart gets zoomed.
By default both mechanisms are disabled.
Using the Smart Labels Mode
You can enable the smart labels mode by setting the SmartLabelsMode property of the axis.
<telerik:RadCartesianChart.VerticalAxis>
<telerik:LinearAxis SmartLabelsMode="SmartStep"/>
</telerik:RadCartesianChart.VerticalAxis>
- None (default value): Do not attempt to avoid overlapping labels
- SmartStep: The axis will choose a step (or a tick interval) in such a way that labels don’t overlap
-
SmartStepAndRange: The axis will choose a step and range in such a way that labels don’t overlap
This mode is supported only by the LinearAxis and the LogarithmicAxis.
The following picture demonstrates the different modes.
Enable Step Recalculation on Zoom
The chart axis major step is automatically recalculated on zoom. To disable this, set the IsStepRecalculationOnZoomEnabled property of the axis to False.
<telerik:RadCartesianChart.VerticalAxis>
<telerik:LinearAxis IsStepRecalculationOnZoomEnabled="False"/>
</telerik:RadCartesianChart.VerticalAxis>
This mechanism is supported only by the chart's numeric axes.