Currency format for treemap level header

Hi, is it possible to apply a currency format, N0 for example, for the content of the HeaderFormat of a treemap level?

I've set the Format property of the treemap at N0 but doesn't seems to work.

Here's the code I use for my treemap:


The estimation field is an int and I would like to format it with the N0 currency format

Thank you and have a nice day

Antoine Roy-Lachance


5 Replies

IR Indumathi Ravi Syncfusion Team November 25, 2021 07:31 PM UTC

Hi Antoine, 
Thank you for contacting Syncfusion Support. 
We can set the currency format for the labels in the TreeMap component using “Format” property by setting “C0” value in the property. Please find the code snippet for the same below. 
Code Snippet
<SfTreeMap Format="C0"> </SfTreeMap> 
We have created a sample to demonstrate the same and it can be found from the below link. 
In the above sample, tooltip and header format for a TreeMap level is set to currency format. Please let us know if the above sample meets your requirement. 
Regards, 
Indumathi R. 



AR Antoine Roy-Lachance November 25, 2021 07:45 PM UTC

Hi I would like to use the N0 format, the C0 format works fine but it doesn't meet my requirements.

Here's an example of the format I would like to apply for the numbers in the treemap:


I want a comma as a seperator

Thank you and have a nice day

Antoine Roy-Lachance



IR Indumathi Ravi Syncfusion Team November 26, 2021 03:26 PM UTC

Hi Antoine, 
  
Thank you for your update. 
  
We can achieve your requirement by setting “N0” in the “Format” property and “EnableGroupingSeparator” property as “true” in the TreeMap component. The “EnableGroupingSeparator” property is used to enable the comma separator in the number format of the labels in the TreeMap. Please find the code snippet for the same below. 
  
Code Snippet
<SfTreeMap EnableGroupingSeparator=true Format="N0"> </SfTreeMap> 
 
  
We have modified the sample to demonstrate the same and it can be found from the below link. 
  
Please let us know if you need any further assistance. 
  
Regards, 
Indumathi R. 



AR Antoine Roy-Lachance November 26, 2021 03:41 PM UTC

Hi!

I tried it and it works fine :)

thank you for your support!

Antoine



IR Indumathi Ravi Syncfusion Team November 29, 2021 11:44 AM UTC

Hi Antoine, 
  
Thank you for the update. 
  
Please let us know if you need any further assistance. 
  
Regards, 
Indumathi R. 


Loader.
Up arrow icon