I am trying to create a donut chart using json from a local variable (rather than an external file) I have seen this post but am having a hard time adjusting my code in the same way
In the above example
d3.json("flare.json", function(error, root) {
was replaced with
root = JSON.parse( myjson );
which does not fix my problem
Check out the fiddle below where my data is loaded as variable titled myJson. How can I use this data for the donut?
Fiddle
data
.d3.json
call (but keep the code within it).Complete jsfiddle here. You also need to append your SVG to "body" and not "#body".
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