var sales = d3.csv("Sales Export Friendly 3-19-17.csv", function(error, data) {
//var parseDate = d3.time.format("%m/%d/%Y %H:%M:%S %p").parse;
return {
unit: data["Unit Booked"],
date: new Date(data["Booking Date"]).getMonth() + 1,
checkin: new Date(data["Checkin"]).getMonth() + 1,
LOS: new Date(data["Checkout"]).valueOf() - new Date(data["Checkin"]).valueOf()/(24*60*60*1000),
total: +data["Total Stay"],
avgNight: (+data["Total Stay"]) / ((new Date(data["Checkout"]).valueOf() - new Date(data["Checkin"]).valueOf())/(24*60*60*1000))
}
});
console.log(sales);
console.log(d3.keys(sales[0]));
parcoords = d3.parcoords()("#TopLeft");
parcoords
the console logging statement on sales returns
Object { header: Cn/u.header(), mimeType: Cn/u.mimeType(), responseType: Cn/u.responseType(), response: Cn/u.response(), get: Cn/</u[n](), post: Cn/</u[n](), send: Cn/u.send(), abort: Cn/u.abort(), on: M/<(), row: e/o.row() }
I'm not sure how this weird object happened.
And the following console.log statement returns an empty array.
Last, I get a TypeError: data.slice is not a function when calling parcoords