From c54953c07b71a14d220fab8ca736088a3f1d3d4c Mon Sep 17 00:00:00 2001 From: plainheart Date: Tue, 3 May 2022 04:30:13 +0800 Subject: [PATCH] fix(markLine): fix markLine label shows wrong tooltip content. --- src/component/marker/MarkLineView.ts | 4 ++- test/marker-case.html | 42 +++++++++++++++++++++++++-- test/runTest/actions/__meta__.json | 1 + test/runTest/actions/marker-case.json | 1 + 4 files changed, 45 insertions(+), 3 deletions(-) create mode 100644 test/runTest/actions/marker-case.json diff --git a/src/component/marker/MarkLineView.ts b/src/component/marker/MarkLineView.ts index f907f146ce..d3d6a661d8 100644 --- a/src/component/marker/MarkLineView.ts +++ b/src/component/marker/MarkLineView.ts @@ -382,7 +382,9 @@ class MarkLineView extends MarkerView { // Set host model for tooltip // FIXME - mlData.line.eachItemGraphicEl(function (el, idx) { + mlData.line.eachItemGraphicEl(function (el) { + getECData(el).dataModel = mlModel; + el.traverse(function (child) { getECData(child).dataModel = mlModel; }); diff --git a/test/marker-case.html b/test/marker-case.html index 756fa49dda..a02e9e1f6e 100644 --- a/test/marker-case.html +++ b/test/marker-case.html @@ -38,7 +38,7 @@
- +
@@ -105,7 +105,45 @@ }); - + diff --git a/test/runTest/actions/__meta__.json b/test/runTest/actions/__meta__.json index 380a5f1da8..f8becd5180 100644 --- a/test/runTest/actions/__meta__.json +++ b/test/runTest/actions/__meta__.json @@ -134,6 +134,7 @@ "map-province": 1, "mapWorld": 1, "markArea": 3, + "marker-case": 1, "media-dataZoom": 1, "media-finance": 2, "media-pie": 1, diff --git a/test/runTest/actions/marker-case.json b/test/runTest/actions/marker-case.json new file mode 100644 index 0000000000..7c97b2ead6 --- /dev/null +++ b/test/runTest/actions/marker-case.json @@ -0,0 +1 @@ +[{"name":"Action 1","ops":[{"type":"screenshot","time":2416},{"type":"mousemove","time":3413,"x":681,"y":329},{"type":"mousemove","time":3613,"x":712,"y":345},{"type":"mousemove","time":3814,"x":737,"y":339},{"type":"mousemove","time":4015,"x":743,"y":328},{"type":"mousemove","time":5506,"x":743,"y":327},{"type":"screenshot","time":5524}],"scrollY":352,"scrollX":0,"timestamp":1651523314434}] \ No newline at end of file