From c961fc7e7d86d7156b8a6846c4a38087d424a414 Mon Sep 17 00:00:00 2001 From: hantianjiao Date: Sat, 2 Nov 2019 22:54:15 +0800 Subject: [PATCH 1/2] fix(line): axis pointer highlights data outside of chart #11360 --- src/chart/line/LineView.js | 5 ++++ test/clip.html | 61 ++++++++++++++++++++++++++++++++++++++ 2 files changed, 66 insertions(+) diff --git a/src/chart/line/LineView.js b/src/chart/line/LineView.js index 8613fe88ec..b966d92add 100644 --- a/src/chart/line/LineView.js +++ b/src/chart/line/LineView.js @@ -369,6 +369,7 @@ export default ChartView.extend({ clipShapeForSymbol.r1 += 0.5; } } + this._clipShapeForSymbol = clipShapeForSymbol; // Initialization animation or coordinate system changed if ( !(polyline && prevCoordSys.type === coordSys.type && step === this._step) @@ -521,6 +522,10 @@ export default ChartView.extend({ // Null data return; } + // fix #11360: don't draw symbol if clip is true and symbol is outside the visible area + if (seriesModel.get('clip', true) && !this._clipShapeForSymbol.contain(pt[0], pt[1])) { + return; + } symbol = new SymbolClz(data, dataIndex); symbol.position = pt; symbol.setZ( diff --git a/test/clip.html b/test/clip.html index 0a2ad60643..b4e1d6d2ac 100644 --- a/test/clip.html +++ b/test/clip.html @@ -1330,5 +1330,66 @@ }); }); + + + +
+ + \ No newline at end of file From e98eb0530e00a11ad13199e6a39047de07703bd4 Mon Sep 17 00:00:00 2001 From: hantianjiao Date: Wed, 6 Nov 2019 13:54:53 +0800 Subject: [PATCH 2/2] fix: should't draw symbol outside clipShapeForSymbol --- src/chart/line/LineView.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/chart/line/LineView.js b/src/chart/line/LineView.js index b966d92add..4db528a6d9 100644 --- a/src/chart/line/LineView.js +++ b/src/chart/line/LineView.js @@ -522,8 +522,8 @@ export default ChartView.extend({ // Null data return; } - // fix #11360: don't draw symbol if clip is true and symbol is outside the visible area - if (seriesModel.get('clip', true) && !this._clipShapeForSymbol.contain(pt[0], pt[1])) { + // fix #11360: should't draw symbol outside clipShapeForSymbol + if (this._clipShapeForSymbol && !this._clipShapeForSymbol.contain(pt[0], pt[1])) { return; } symbol = new SymbolClz(data, dataIndex);