How to format the data?

  1. I want to format the Y Axis value with a thousand separator. Tried to set the labelFormat to "n0" but does not work.

  2. I, in another chart, want to set the value (in the bar) as percentage, e.g. 0.15 as 15%. don't know how can I do it, i.e. what property to set. 
Thanks

John

4 Replies

JC John Chen December 9, 2021 10:19 PM UTC

for (2), I found that it is the property of the dataLabel.

two way to do it. a) use template, and b) use text mapping (I used this method). 



DG Durga Gopalakrishnan Syncfusion Team December 10, 2021 03:10 PM UTC

Hi John, 

Greetings from Syncfusion. 

Query : I want to format the Y Axis value with a thousand separator. Tried to set the labelFormat to "n0" but does not work. 

We suggest you to enable useGroupingSeparator property to separate groups of thousands. Please check with the below documentation link. 


Please revert us if you have any concerns. 

Regards, 
Durga G 



JC John Chen December 19, 2021 08:07 PM UTC

Thanks Durga,

enable useGroupingSeparator property worked.

But, just in case others reading it, I still need to set the labelFormat: 'N0'. Otherwise, the label sometimes show "000" after the decimal point even I made sure all data are integers.


Best,

John



DG Durga Gopalakrishnan Syncfusion Team December 20, 2021 12:34 PM UTC

Hi John, 
  
Most welcome. The property useGroupingSeparator is used to group thousands using commas, but the labelFormatN0’ is used to display the axis label without any decimal values. Please get back to us if you need further assistance. 
  
Regards, 
Durga G

Loader.
Up arrow icon