Axis Smart Labels

The RadChartView suite supports couple of 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.

Setting the smart labels mode to SmartStep

<telerik:RadCartesianChart.VerticalAxis> 
    <telerik:LinearAxis SmartLabelsMode="SmartStep"/> 
</telerik:RadCartesianChart.VerticalAxis> 
The SmartLabelMode property is of type AxisSmartLabelsMode enum and it determines 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.

    SmartStepAndRange is supported only by the LinearAxis and LogarithmicAxis.

Example illustrating the SmartStep mode applied on both chart axes (horizontal and vertical)

radchartview-features-axis-smart-labels

Example illustrating the SmartStepAndRange mode applied on the vertical axis

radchartview-features-axis-smart-labels

Disable the 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.

Disabling the automatic step recalculation on zoom

<telerik:RadCartesianChart.VerticalAxis> 
    <telerik:LinearAxis IsStepRecalculationOnZoomEnabled="False"/> 
</telerik:RadCartesianChart.VerticalAxis> 
Example illustrating how the IsStepRecalculationOnZoomEnabled property affects the axis (applied only on the vertical axis)

radchartview-features-axis-smart-labels

This mechanism is supported only by the chart's numeric axes.

See Also

In this article