score:1

Accepted answer

Looks like you use d3.v5

In d3 v5 introduced fetch API Method d3.csv returns promise

try this:

d3.csv("./Fake2.csv").then(function(d){
    d3.select("body").selectAll("p")
        .data(d2)
        .enter()
        .append("p")
        .text("New paragraph");
})

PS. Fetch API is a modern feature and not every browser or engine support it.


Related Query