我导入了一个csv文件并尝试在d3上映射信息.我想我已经适当地缩放了一切.任何人都可以帮助我并指导我完成这项工作吗?
我收到以下错误:
d3.min.js:1 Error: <path> attribute d: Expected number, "MNaN,NaNLNaN,NaNL…".
Run Code Online (Sandbox Code Playgroud)
csv文件中的数据如下:
------------------------------------------
| 00:00:01 | 1 |
------------------------------------------
| 00:05:01 | 2 |
------------------------------------------
| 00:10:01 | 3 |
------------------------------------------
| 00:15:01 | 5 |
------------------------------------------
Run Code Online (Sandbox Code Playgroud)
这是代码.
var Chart = (function(window,d3) {
var svg, data, x, y, xAxis, yAxis, dim, chartWrapper, line, path, margin = {}, width, height;
d3.csv('Book1.csv', init); //load data, then initialize chart
//called once the data is loaded
function init(csv) {
data = csv;
//initialize scales
xExtent …Run Code Online (Sandbox Code Playgroud)