maybe a bit better?

This commit is contained in:
philipp 2023-10-01 14:01:34 +02:00
parent 020afbb419
commit fa66efa361

View File

@ -91,8 +91,12 @@ const y = d3.scaleLinear()
.attr("text-anchor", "start")
.text("↑ Daily km ($)"));
d3.csv("../public/csv/stats.csv", function(d) {
return { date : d3.timeParse("%Y-%m-%d")(d.date), value : d.km }
d3.csv("../public/csv/stats.csv").then(function(data) {
data.forEach(function(d) {
d.date = d3.timeParse("%Y-%m-%d")(d.date);
d.km = +d.km;
console.log(d);
});
}, function(error, data) {
if (error) throw error;