FVANCOP / ChartNew.js

MIT License
420 stars 142 forks source link

human numbers #436

Closed AK1979 closed 8 years ago

AK1979 commented 8 years ago

Hi ,

Is there any option to display human friendly numbers ?

10,000 = 10K and so on ....

FVANCOP commented 8 years ago

Yes, this is not too difficult. You have to change the default value for the "format" option.

see : https://github.com/FVANCOP/ChartNew.js/wiki/100_050_Format and https://github.com/FVANCOP/ChartNew.js/wiki/900_010_format.js

AK1979 commented 8 years ago

I can see date / time / round format options but not the above format.

Which format changes to human numbers ? 10000 to 10K , 1,000,000 to 1M and so on ..

Thanks :)

markosko commented 8 years ago

Check this one from wiki page https://github.com/FVANCOP/ChartNew.js/wiki/900_010_format.js#abreviatenumber This should be what you are looking for.

AK1979 commented 8 years ago

Hi ,

thanks a lot .

Few questions :

can i use the "fmtYLabel : "abbreviatenumber" in a dougnut ?

Is it possible in Line charts to adjust the annotateLabel and to data inGrapData format to "abbreviatenumber" ?

FVANCOP commented 8 years ago

Hi,

FmtYLabel is an option only valid for chart with axis; No axis in Doughnut, so fmtYLabel cannot be used in doughnuts.

To use the "abbreviateNumber in the annotate, set option fmtV3 : "abbreviateNumber".

Regards, François