Skip to content

Commit 76df978

Browse files
authored
fix: fix the display of selected points in the tooltip (#506)
1 parent 269ecfe commit 76df978

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/core/utils/get-closest-data.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -76,8 +76,8 @@ function getClosestPointsByXValue(x: number, y: number, points: ShapePoint[]) {
7676
return [];
7777
}
7878

79-
const closestX = sorted[closestXIndex].x;
80-
const filtered = points.filter((p) => p.x === closestX);
79+
const closestX = Math.round(sorted[closestXIndex].x);
80+
const filtered = points.filter((p) => Math.round(p.x) === closestX);
8181

8282
const groupedBySeries = Object.values(groupBy(filtered, (p) => get(p.series, 'id'))).map(
8383
(items) => {

0 commit comments

Comments
 (0)