precision -1 out of range
shinnc opened this issue · 6 comments
I got the error from this line, may I know what's the reason there's a negative number for the precision
?
// echarts-stat/dist/ecStat.js:1393
return + ((stop >= start ? step1 : -step1).toFixed(-precision));
These are the arguments in the function triggered the error: start=1199, stop=1953, count=9
This is how I initialize the graph:
data = [1701, 1585, 1669, 1953, 1429, 1593, 1641, 1638, 1768, 1524, 1608, 1679, 1731, 1254, 1232, 1238, 1661, 1199, 1921, 1731, 1570, 1548, 1521, 1548, 1620, 1811, 1696, 1527, 1771, 1477, 1775, 1672, 1330, 1400, 1780, 1716, 1811, 1626, 1519, 1395, 1677, 1295, 1317, 1411, 1524, 1291, 1570, 1540, 1690, 1616, 1707, 1748, 1631, 1569, 1557, 1602, 1530, 1811, 1606, 1480, 1528, 1277, 1638, 1579, 1580, 1493]
const bins = ecStat.histogram(data)
Edited: Just notice there's existing PR and issues #16, #21 addressing this, hence closing. Any maintainers care to merge the PR and release it?
@deqingli 麻烦请问下大佬这个库是否还有后续的维护更新?直方图遇到同样的问题。
@wmhh1129 I fixed it by myself, realised that the PR #18 wasn't really fixing the actual issue. urbanzoom@e389533
@shinnyx sounds cool,i also realised that the PR seems useless,have you release your version in npm?
@wmhh1129 Nope I didn't, I just explicitly specify in package.json
to use the github version at the moment.
Is there anyone who can run a fork of this with these changes?