score:0

Accepted answer

When you load a file with d3.json, it uses an http request. If the file is local, most modern browsers will refuse to GET the file, because that would be a security risk to users of their browsers (GET c:\allmypasswords.txt)

Firefox is more permissive with requesting local files from locally run HTML, so you can try running your code there. The alternative is to serve the JSON file with a server, either by hosting it on the web or running a server locally.

EDIT It seems the issue is actually the JSON. You have two values that contain leading decimals. When I added a 0 in front of the decimal it worked. Weird.


Related Query

More Query from same tag