githiro / drawDoughnutChart

A SVG doughnut chart with animation and tooltip.
http://codepen.io/githiro/details/ICfFE
88 stars 40 forks source link

Decimal Places in Total #6

Open DesignerWhere opened 9 years ago

DesignerWhere commented 9 years ago

I noticed that the TOTAL defaults to a single decimal place, so even it's a whole number, it still shows 120.0

Is it possible to adjust it so if there's no decimal places, it defaults to a whole number, and if there is, then it shows it? Maybe with a setting to control the number of decimal places?

Thanks

DesignerWhere commented 9 years ago

I found a line:

.text((segmentTotal * animationDecimal).toFixed(0));

Which I've adjust to ".toFixed(0));" from the default of ".toFixed(1));" - maybe make this within the options settings?