Y Axis - Display values in millions as $0.5m instead of $500,000

I want to be able to display the axis labels of large numbers rounded by millions. So if I was to have a range of numbers between 500,000 and 2,000,000 the Y Axis would show a value of 500,000 as 0.5m and the value of 2,000,000 would show as 2m. How can I achieve this?



3 Replies

DG Durga Gopalakrishnan Syncfusion Team May 26, 2020 02:19 PM UTC

Hi Glen, 

Greetings from Syncfusion. 

We have analysed your query. We suggest you to use axisLabelRender event to customize the axis labels. We have prepared sample for your reference. Please check with below code snippet and sample. 

public axisLabelRender(args:IAxisLabelRenderEventArgs): void{ 
      if(args.axis.name == "primaryYAxis" ){ 
          args.text = (args.text/1000000) + 'm'; 
      } 
}; 
 
 

Kindly revert us, if you have any concerns. 

Regards, 
Durga G 



SS Sarasilmiya Shahul Hameed Syncfusion Team May 27, 2020 04:18 AM UTC

From: Glen Alexander 
Sent: Tuesday, May 26, 2020 8:12 PM
To: Syncfusion Support <[email protected]>
Subject: RE: Syncfusion support community forum 154545, Y Axis - Display values in millions as $0.5m instead of $500,000, has been updated. 
Thank you, got it working eventually. I had useGroupingSeparator enabled, so it was breaking it. Took a bit to figure out that’s why it wasn’t working! 

Glen Alexander 



DG Durga Gopalakrishnan Syncfusion Team May 28, 2020 01:16 PM UTC

Hi Glen, 

Most welcome. Kindly get in touch with us, if you need any further assistance. We are always happy in assisting you.  

Regards, 
Durga G 


Loader.
Up arrow icon