Articles in this section

How to change the format of label values in the WPF OLAP Chart?

This article explains how to apply different numeric formats such as currency, percentage, or number formats to axis label values in the Syncfusion WPF OLAP Chart. By customizing the LabelFormat property of the SecondaryAxis, you can easily control how numeric values appear in your chart visualization.

This is useful when presenting financial values, ratios, or general numeric data in a more readable, user-friendly manner.

Follow these steps to change the label value format in the WPF OLAP Chart:

Step 1: Configure the OLAP Data Manager

Initialize the OlapDataManager and set your OLAP report. For more information, refer this getting started documentation

public MainWindow()
{
   InitializeComponent();

   this.olapChart.OlapDataManager = 
       new Syncfusion.Olap.Manager.OlapDataManager(
       "Data Source=https://bi.syncfusion.com/olap/msmdpump.dll; Initial Catalog=Adventure Works DW 2008 SE;");

   this.olapChart.OlapDataManager.SetCurrentReport(SampleReport());

   this.olapChart.Loaded += OlapChart_Loaded;
}
Public Sub New()
   InitializeComponent()

   Me.olapChart.OlapDataManager =
       New Syncfusion.Olap.Manager.OlapDataManager(
       "Data Source=https://bi.syncfusion.com/olap/msmdpump.dll; Initial Catalog=Adventure Works DW 2008 SE;")

   Me.olapChart.OlapDataManager.SetCurrentReport(SampleReport())

   AddHandler Me.olapChart.Loaded, AddressOf OlapChart_Loaded
End Sub

Step 2: Apply Label Formatting in the Loaded Event

Inside the Loaded event, set the LabelFormat of the SecondaryAxis to one of the predefined .NET numeric formats.

void OlapChart_Loaded(object sender, RoutedEventArgs e)
{
   // Currency format example: "$23,345"
   this.olapChart.OlapChartArea.SecondaryAxis.LabelFormat = "C";

   // Percentage format example: "23,345%"
   this.olapChart.OlapChartArea.SecondaryAxis.LabelFormat = "P";

   // Number format example: "23,345"
   this.olapChart.OlapChartArea.SecondaryAxis.LabelFormat = "N";
} 
Private Sub OlapChart_Loaded(ByVal sender As Object, ByVal e As RoutedEventArgs)
   ' Currency format: "$23,345"
   Me.olapChart.OlapChartArea.SecondaryAxis.LabelFormat = "C"

   ' Percentage format: "23,345%"
   Me.olapChart.OlapChartArea.SecondaryAxis.LabelFormat = "P"

   ' Number format: "23,345"
   Me.olapChart.OlapChartArea.SecondaryAxis.LabelFormat = "N"
End Sub 

Output

Depending on the LabelFormat applied, the axis will display formatted values.

Currency format example

Conclusion

I hope you enjoyed learning about how to change the format of label values in the WPF OLAP Chart.

You can refer to our WPF OlapChart featuretour page to know about its other groundbreaking feature representations and documentation, and how to quickly get started for configuration specifications. You can also explore our WPF OLAP Chart demo to understand how to create and manipulate data.

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

If you have any queries or require clarifications, please let us know in the comments section below. You can also contact us through our support forums, Direct-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