提交 e3d23440 编写于 作者: S sushuang

Fix raw index query (tooltip connect abnormal)

上级 46efa1da
...@@ -18,7 +18,7 @@ export default function (finder, ecModel) { ...@@ -18,7 +18,7 @@ export default function (finder, ecModel) {
var data = seriesModel.getData(); var data = seriesModel.getData();
var dataIndex = modelUtil.queryDataIndex(data, finder); var dataIndex = modelUtil.queryDataIndex(data, finder);
if (dataIndex == null || zrUtil.isArray(dataIndex)) { if (dataIndex == null || dataIndex < 0 || zrUtil.isArray(dataIndex)) {
return {point: []}; return {point: []};
} }
......
...@@ -838,17 +838,21 @@ listProto.indexOfRawIndex = function (rawIndex) { ...@@ -838,17 +838,21 @@ listProto.indexOfRawIndex = function (rawIndex) {
return rawIndex; return rawIndex;
} }
if (rawIndex >= this._rawCount || rawIndex < 0) {
return -1;
}
// Indices are ascending // Indices are ascending
var indices = this._indices; var indices = this._indices;
// If rawIndex === dataIndex // If rawIndex === dataIndex
var rawDataIndex = indices[rawIndex]; var rawDataIndex = indices[rawIndex];
if (rawDataIndex != null && rawDataIndex === rawIndex) { if (rawDataIndex != null && rawDataIndex < this._count && rawDataIndex === rawIndex) {
return rawIndex; return rawIndex;
} }
var left = 0; var left = 0;
var right = indices.length - 1; var right = this._count - 1;
while (left <= right) { while (left <= right) {
var mid = (left + right) / 2 | 0; var mid = (left + right) / 2 | 0;
if (indices[mid] < rawIndex) { if (indices[mid] < rawIndex) {
......
...@@ -1006,6 +1006,9 @@ function updateDirectly(ecIns, method, payload, mainType, subType) { ...@@ -1006,6 +1006,9 @@ function updateDirectly(ecIns, method, payload, mainType, subType) {
// broadcast // broadcast
if (!mainType) { if (!mainType) {
// FIXME
// Chart will not be update directly here, except set dirty.
// But there is no such scenario now.
each(ecIns._componentsViews.concat(ecIns._chartsViews), callView); each(ecIns._componentsViews.concat(ecIns._chartsViews), callView);
return; return;
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册