chart axis label

Hello 

Is there a way to restrict the y axis label to 2 digits after decimals. In the below image we have single, double and triple digits after the decimal

Is there a way to make it consistent , i.e always 2 digits after decimal.





1 Reply

BP Baby Palanidurai Syncfusion Team May 31, 2018 05:41 AM UTC

Hi Manu, 

Thanks for using syncfusion products, 

We have analyzed your query. Your requirement can be achieved by using labelFormat property in the axis.  We are having the following predefined label formats for numeric axis and also supports custom label format using placeholder like ${value}k, in which the value represent the axis label e.g $20k 
  1. n1
  2. n2
  3. n3
  4. p1
  5. p2
  6. p3
  7. c
  8. c1
  9. c2.
 
To display 2 digits after decimal, you can use labelFormat as n2. 
 
For more information on numeric axis label formats, kindly find the help document.  

Please find the code snippet below to achieve this requirement. 

        primaryYAxis: { 
            labelFormat: 'n2' 
        }, 

Screenshot:  
 

Sample for your reference can be find from below link, 


Kindly revert us, if you have any concerns. 

Thanks, 
Baby. 


Loader.
Up arrow icon