this is my fiddle, which I am building with from this example
what is the best way to convert the text lables from 0.08 to 8% format.
This is my attempt, but is there a better/other way?
.text(function(d) { return Math.floor(d.frequency*100)+"%"; });
The most common way to do it (let's call it the "d3 way") is to use the d3 formatting functions:
var format = d3.format("%");
Here is the Fiddle: https://jsfiddle.net/cr91xf1t/
You can play with several built in formats, or even create your own. Have a look here: http://bl.ocks.org/zanarmstrong/05c1e95bf7aa16c4768e
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With