import a csv file
(导入一个CSV文件)
Plotly.d3.csv("states.csv", function(error, stateData) {
if (error) return console.warn(error);
});
var trace1 = {
x: stateData.map(row =>row.state),
y: stateData.map(row =>row.year),
type: "bar"
};
var data = [trace1]
var layout = {
title : " State graph",
barmode: "group"
};
Plotly.newPlot("plot", data, layout);
I want to do bar chart from my csv file, code it doesn't work.
(我想从我的csv文件中制作条形图,将其编码无效。)
Is there any other way to approach this problem ?(还有其他方法可以解决此问题吗?)
ask by ruddy simonpour translate from so
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…