Hi so i'm in the middle of learning the D3 Framework, but no matter what I do, I can't seem to load my Json file. I'm running the script on a server and the JSON file is in the same directory as the html/d3 file im running it from but it keeps giving me a 404 error when I look at the console.
So Im running it on www.mywebsite.com, and then I have the Json file stored in www.mywebsite.com/mydata.json
Can anyone help me out?
<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>