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

折线图的dataZoom能否指定下标而不是百分比? #1150

Closed
nilday opened this issue Jan 12, 2015 · 3 comments
Closed

折线图的dataZoom能否指定下标而不是百分比? #1150

nilday opened this issue Jan 12, 2015 · 3 comments

Comments

@nilday
Copy link

nilday commented Jan 12, 2015

在对折线图的dataZoom进行处理的时候,如果是x轴的项目数超过了100,使用dataZoom的0到100的选项就不能很好的指定到某个特定点的起止位置(如果我没猜错是使用了取整操作?)。能否dataZoom的start end选项使用index来表示而不是0到100?同理DATA_ZOOM事件能否返回下标而不是0-100的百分比,在转化 时候总会失去一些精度。

@kener
Copy link
Contributor

kener commented Jan 12, 2015

start是floor,end是ceil。不应该有无法指定的位置啊?取index只是一个乘法问题。

@nilday
Copy link
Author

nilday commented Jan 12, 2015

实际上看来确实有精度问题
dataZoom : {
show : true,
realtime: true,
start : start=='start'?0:xAxis.indexOf(start)/xAxis.length_100,
end : end=='end'?100:xAxis.indexOf(end)/xAxis.length_100
}
这样一个语句,其中start,end分别代表横轴序列xAxis中的一个元素,这样取出来的start,end不会精确的显示为以start为开始,end为结束的一个区间。

另一方面,在拖动data_zoom产生DATA_ZOOM事件的时候,由于返回的是0-100的整数,如果横轴元素大于100个,会出现拖动到多个元素都返回同一个整数的情况,无法精确获取到底起止位置是哪一个index。

@kener
Copy link
Contributor

kener commented Jan 12, 2015

你是对的,dataZoom事件返回的start和end不应该去精度,已升级,谢谢反馈。

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