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.
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>
The SmartLabelMode property is of type AxisSmartLabelsMode enum and it defines the algorithm which should be used for generating the labels. The enumeration expose the following properties:
- 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.
You can enable the automatic recalculation of the axis labels when you zoom in/out the chart by setting the IsStepRecalculationOnZoomEnabled property to True.
<telerik:RadCartesianChart.VerticalAxis> <telerik:LinearAxis IsStepRecalculationOnZoomEnabled="True"/> </telerik:RadCartesianChart.VerticalAxis>
The following picture demonstrates this feature:
This mechanism is supported only by the chart's numeric axes.