0

I am a new beginner to JavaScript and D3. I just want to import the csv data file into the D3 using d3.csv but I get the following error. Anyone can help me with this?

<!DOCTYPE html>
<html>
<head>
   <title>Learning JavaScript</title>
   <script src = "https://d3js.org/d3.v3.min.js"></script>
</head>
<body>
  <script>

        d3.csv("data.csv", function(d){

          console.log(d);

        })
  </script>
</body>
</html>

]1]1

Hokhy Tann
  • 1,249
  • 1
  • 9
  • 14
  • what is output (error) in the console? – Abdullah Danyal Jul 19 '17 at 08:22
  • like the picture I added, you can click on the number 1 to view it, thanks! – Hokhy Tann Jul 19 '17 at 08:47
  • It is because, browsers did not allow you to load data locally due to security reasons. It is mostly the case with chrome. Firefox wont do this, you can try on Firefox. It is better explained in this post as well : https://stackoverflow.com/questions/21006647/cannot-import-data-from-csv-file-in-d3 – Abdullah Danyal Jul 19 '17 at 09:03

0 Answers0