Articles in this section

How to add a prefix and suffix for axis labels in .NET MAUI Chart (SfCartesianChart)?

The .NET MAUI Chart supports axis labels that display units, measures, or category values, enhancing data visualization. The LabelFormat property enables you to add a prefix and suffix to the axis labels, available in the LabelStyle property of the ChartAxis.


.NET MAUI Chart axis labels formatted with the prefix "$" and suffix "B"

xmlns:chart="clr-namespace:Syncfusion.Maui.Charts;assembly=Syncfusion.Maui.Charts"
 
<chart:SfCartesianChart IsTransposed="True">
  ... 
  <chart:SfCartesianChart.XAxes>
     <chart:CategoryAxis></chart:CategoryAxis>
  </chart:SfCartesianChart.XAxes>
 
  <chart:SfCartesianChart.YAxes>
     <chart:NumericalAxis>
         <chart:NumericalAxis.LabelStyle>
            <chart:ChartAxisLabelStyle LabelFormat="$0B"></chart:ChartAxisLabelStyle>
         </chart:NumericalAxis.LabelStyle>
     </chart:NumericalAxis>
  </chart:SfCartesianChart.YAxes>
  ... 
</chart:SfCartesianChart>
using Syncfusion.Maui.Charts;
 
SfCartesianChart chart = new SfCartesianChart();
chart.IsTransposed = true; 
…
CategoryAxis categoryAxis = new CategoryAxis();
 
NumericalAxis numericalAxis = new NumericalAxis();
 
numericalAxis.LabelStyle = new ChartAxisLabelStyle()
{
    LabelFormat = "$0B"
};       
chart.XAxes.Add(categoryAxis);
chart.YAxes.Add(numericalAxis);
…

Conclusion

I hope you enjoyed learning how to add a prefix and suffix for axis labels in .NET MAUI Chart.

You can refer to our .NET MAUI Chart feature tour page to learn about its other groundbreaking feature representations. Explore our .NET MAUI Chart documentation to understand how to present and manipulate data. 

For current customers, check out our .NET MAUI components from the License and Downloads page. If you are new to Syncfusion®, try our 30-day free trial to check out our .NET MAUI Chart and other .NET MAUI components.

Please let us know in the comments section if you have any queries or require clarification. You can also contact us through our support forumsDirect-Trac, or feedback portal. We are always happy to assist you!

 

 

Did you find this information helpful?
Yes
No
Help us improve this page
Please provide feedback or comments
Comments (0)
Access denied
Access denied