提交 60d341f4 编写于 作者: L lang

Enhancement of case #2869

上级 3bca1c7e
......@@ -490,8 +490,14 @@ define(function (require) {
var minDist = Number.MAX_VALUE;
var nearestIdx = -1;
for (var i = 0, len = this.count(); i < len; i++) {
var dist = Math.abs(this.get(dim, i, stack) - value);
if (dist <= minDist) {
var diff = value - this.get(dim, i, stack);
var dist = Math.abs(diff);
if (dist < minDist
// For the case of two data are same on xAxis, which has sequence data.
// Show the nearest index
// https://github.com/ecomfe/echarts/issues/2869
|| (dist === minDist && diff > 0)
) {
minDist = dist;
nearestIdx = i;
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册