Category / Section
How to add prefix and suffix for axis labels in Chart?
1 min read
SfChart provides support to add prefix and suffix to axis labels. The LabelFormat property is used to add prefix and suffix to axis labels, which are available in LabelStyle of chart axis.
The following code illustrates how to add prefix and suffix to axis labels.
XAML
<chart:SfChart.SecondaryAxis> <chart:NumericalAxis> <chart:NumericalAxis.LabelStyle> <chart:ChartAxisLabelStyle LabelFormat = "$###K" /> </chart:NumericalAxis.LabelStyle> </chart:NumericalAxis> </chart:SfChart.SecondaryAxis>
C#
NumericalAxis secondary = new NumericalAxis(); secondary.LabelStyle = new ChartAxisLabelStyle() { LabelFormat = "$###K", };
Output: