I am currently learning the D3 Framework, and I'm facing an issue with loading my Json file. Despite running the script on a server and having the JSON file in the same directory as the html/d3 file, I keep getting a 404 error when checking the console.
The setup is on www.mywebsite.com, and the Json file is stored in www.mywebsite.com/mydata.json. Can anyone provide assistance?
<script src="http://d3js.org/d3.v3.min.js" charset="utf-8"></script>
</head>
<body>
<script type="text/javascript">
d3.json("mydata.json", function(data){
var canvas= d3.select("body").append("svg")
.attr("width",500)
.attr("height", 500)
canvas.selectAll("rect")
.data(data)
.enter()
.append("rect")
.attr("width", function(d){ return d.age *10;})
.attr("height", 50)
.attr("y", function(d ,i){ return i* 50; })
.attr("fill", "blue");
});
</script>