Using Plotly for the first time to make a time series and not sure what’s going on. Any help would be greatly appreciated!
Plotly.d3.csv("/Users/matthewsexton/Desktop/bitcoin.csv", function(err, rows){
function unpack(rows, key) {
return rows.map(function(row) { return row[key]; });
}
var trace1 = {
type: “scatter”,
mode: “lines”,
name: ‘Bitcoin Opening Price’,
x: unpack(rows, ‘Date’),
y: unpack(rows, ‘Open’),
line: {color: ‘#17BECF’}
}
var trace2 = {
type: “scatter”,
mode: “lines”,
name: ‘Bitcoin Closing Price’,
x: unpack(rows, ‘Date’),
y: unpack(rows, ‘Close’),
line: {color: ‘#7F7F7F’}
}
var data = [trace1,trace2];
var layout = {
title: ‘Bitcoin Stock Price’,
};
Plotly.newPlot(‘myDiv’, data, layout);
})
</script>