javascript - NVD3 Sparkline not rendering correctly from CSV file -
i'm trying use nvd3 d3.js make simple sparkline. i've created several sparklines .csv data, when tried use different data set, gave strange looking sparkline. see here. if change first data value 92 0, shows sparkline.
is bug in nvd3 or doing wrong?
the problem y values strings. changed
monthlydata.push({x: data[i].month, y: data[i].data});
to
monthlydata.push({x: data[i].month, y: +data[i].data});
so y value becomes number. here's the updated version.
Comments
Post a Comment