Here is the beginning of my function:
d3.csv("Sales Export Friendly 2-14-2017.csv", function(data) {
sales = data.map(function(d) { return +d.bookingID, +d.totalPaid ; });
I am wondering why despite my best efforts, I can't get the columns with headers "bookingID" and "totailPaid" from the csv file into an array of 2 columns which I can select with sale[0] and sale[1] later in the function as so:
var x = d3.scaleBand()
.domain(sales.map(function(sale){ return sale[0]; }))
.range([0, width])
.paddingInner([0.1])
var y = d3.scaleLinear()
.range([height, 0])
.domain([0, d3.max(sales.map(function(sale){ return sale[1]; }))]);
I read this Q&A: Array map returning array of undefined when should return array of objects but am still having issues
sales = data.map(function(d) { return [+d.bookingID, +d.totalPaid]; });