0

Want to make a graph with dimple, took most code from an example they provided.

<!DOCTYPE html>
<html>
<head>
  <script src="http://d3js.org/d3.v3.min.js"></script>
  <script src="http://dimplejs.org/dist/dimple.v2.1.6.min.js"></script>
</head>
<body>
<div id="chartContainer">
  <script src="/lib/d3.v3.4.8.js"></script>
  <script src="http://dimplejs.org/dist/dimple.v2.1.6.min.js"></script>
  <script type="text/javascript">
    var svg = dimple.newSvg("#chartContainer", 590, 400);
    d3.tsv("C:/Users/Stephan/Downloads/baseball_data.csv", function (data) {

      var myChart = new dimple.chart(svg, data);
      myChart.setBounds(60, 30, 505, 305);
      var x = myChart.addCategoryAxis("x", "HR");
      x.addOrderRule("Date");
      myChart.addMeasureAxis("y", "height");
      var s = myChart.addSeries(null, dimple.plot.line);
      myChart.draw();
    });
  </script>
</div>
</body>

</html>

When i loaded the page on my little python local server, i get the following errors in the console: Can anyone tell me what is going on there ? :) ( and yes that file and path exists ) GET http://localhost:8000/lib/d3.v3.4.8.js d3.v3.min.js:1 XMLHttpRequest cannot load file:///C:/Users/Stephan/Downloads/baseball_data.csv. Cross origin requests are only supported for protocol schemes: http, data, chrome, chrome-extension, https, chrome-extension-resource.i.send @ d3.v3.min.js:1forEach.i.(anonymous function) @ d3.v3.min.js:1Nt @ d3.v3.min.js:1e @ d3.v3.min.js:3(anonymous function) @ tesst123.html:13 d3.v3.min.js:1 Uncaught NetworkError: Failed to execute 'send' on 'XMLHttpRequest': Failed to load 'file:///C:/Users/Stephan/Downloads/baseball_data.csv'.

hmmmbob
  • 1,167
  • 5
  • 19
  • 33

0 Answers0