How to read in CSV with d3 v4?

前端 未结 5 1392
猫巷女王i
猫巷女王i 2020-12-15 06:02

I\'m just having a little trouble understanding the documentation for CSV Parse with D3. I currently have:

d3.parse(\"data.csv\",function(data){
    salesDa         


        
5条回答
  •  生来不讨喜
    2020-12-15 06:48

    I also could not get the d3.csv("csv_file.csv", function(data) { //modifying code } to work.

    A classmate recommended using the following, which has worked so far:

    d3.csv("data.csv").then(function(data){
    //modifying code
    }
    

    As noted in the comments below, this is a fix if you're running v5 instead of v4.

提交回复
热议问题