Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

地图工具数据区间计算问题 #52

Closed
feiyulike opened this issue Aug 13, 2013 · 1 comment
Closed

地图工具数据区间计算问题 #52

feiyulike opened this issue Aug 13, 2013 · 1 comment

Comments

@feiyulike
Copy link

地图工具在calculable:false并且splitNumber非0情况下数值所在区间定位有问题,例如823会显示在700-800区间,分析源码发现是dataRange.js中getColor(value)下idx取值公式有问题,我在项目中修改为
var idx=_colorList.length -Math.ceil((value - dataRangeOption.min)/((dataRangeOption.max - dataRangeOption.min)/_colorList.length))
问题解决,请予以确认。
另外,个人建议,非线性区间显示的时候应该为0-100,101-200,201-300...或者0-100,100.1-200,200.1-300,这应该取决于precision设置的精度

@kener
Copy link
Contributor

kener commented Aug 13, 2013

赞!果然。公式最后应该是*_colorList.length
Math.round 改 Math.ceil即可,我待会fix到主干上。

关于另外一个建议我们考虑一下,so thx~

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants