Ng2-charts: How to format labels to number ?

Created on 6 Dec 2016  路  5Comments  路  Source: valor-software/ng2-charts

Hi, my labels is an array of number like : [2000000, 1500000, 1000000, 500000, 2500000, 3000000]
I want to display this label with format number, i.e: 2,000,000. How can I do that ?

Here is example:
http://plnkr.co/edit/ioy2Kdn7j0Dv05PWo2Se?p=preview

Thank you very much

Update:
Sorry, I have found the way using DecimalPipe to do these.

All 5 comments

can you update your example with the pipe? I'm curious how to do this

Hi @jkon , I used DecimalPipe:
let label = new DecimalPipe('en').transform(prop);
this.labelsTvDT.push(label);

with prop is '2000000' for example, the label will be 2,000,000

Ah, cool. Thanks!

@nhatdq1810 how can I show my bar values as decimal ?

How can i show my values like 10GB, 20GB ? Anyone help please ?

Was this page helpful?
0 / 5 - 0 ratings

Related issues

alexcastillo picture alexcastillo  路  5Comments

Adwind picture Adwind  路  3Comments

Maistho picture Maistho  路  3Comments

tushartgsit picture tushartgsit  路  5Comments

shenriksen4 picture shenriksen4  路  3Comments