Customizing Axis Labels
The axis labels are automatically generated based on the plotted data and the axis range. The chart allows you to customize their appearance.
Hiding Labels
To hide the axis labels, set the ShowLabels
property to False
.
Setting ShowLabels
Label Interval
The axis labels are positioned on each tick plotted on the axis. To change this, set the LabelInterval
property of the associated axis.
Setting LabelInterval
String Format
To adjust the string format of the labels, set the LabelFormat
property.
Setting LabelFormat
Rotation
To rotate the axis labels, set the LabelFitMode
property to Rotate
. This will rotate to labels to a predefined angle. To change the angle, set the LabelRotationAngle
property.
In order for the LabelRotationAngle
property to take effect, the LabelFitMode
should be set to Rotate
.
Setting LabelFitMode to Rotate
Multi-line Mode
To arrange the labels on different vertical positions that mimics multi-line layout, set the LabelFitMode
property to MultiLine
.
Setting LabelFitMode to MultiLine
Smart Labels
The axis smart labels feature allows you to avoid situations where the axis has too many labels and they start to overlap one another. The smart mode will try to auto-calculate such label interval that no labels overlap. To enable it, set the SmartLabelsMode
property of the axis. Read more in the [Axis Smart Labels]/devtools/wpf/controls/radchartview/axes/axis-smart-labels article.
Label Style
The default visual element of the axis labels is TextBlock
. To customize its appearance, set the axis' LabelStyle
property. The TargetType
of the Style
object should target the TextBlock
class.
Setting LabelStyle
Label Template
To replace the default visual element of the axis labels, set the axis' LabelTemplate
property.
Setting LabelTemplate
Label Template Selector
To replace the default visual element of the axis labels with different elements based on a condition, use the LabelTemplateSelector
property of the axis. The following example shows how to define a DataTemplateSelector and use it to choose between two different DataTemplates.