We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date
close icon

Formatting PrimaryYAxis Label Value


How can I add comma formatting to the PrimaryYAxis label?

For example, I have a value "$2000", but I want it to read "$2,000".

I've tried 'MyChart.LabelFormat.PrimaryYAxis.LabelFormat = "$#,##0";'  but that throws an error.


Anyone have any ideas?

Thanks in advance!

1 Reply

PR Praveen Syncfusion Team April 17, 2015 08:13 AM UTC

Hi Mark,

Thanks for using Syncfusion product.

We can achieve your requirement by applying/setting c0 format in “LabelFormat” of PrimaryYaxis. The 'c0' format is numbers with a currency sign, thousand separators and zero decimal places.

The following code snippet shows this,

[ASP]

LabelFormat="c0"


Screen Shot:


We have also made a sample to illustrate this. Kindly find it from the below location.


Sample:
118864.zip


Please let us know if you have any concern.

Thanks,

Praveenkumar.


Loader.
Live Chat Icon For mobile
Up arrow icon