Skip to content

Commit 7421800

Browse files
fix: 修复坐标轴偏差的 bug
1 parent ba03022 commit 7421800

4 files changed

Lines changed: 12 additions & 19 deletions

File tree

‎__tests__/integration/snapshots/AxisLinearLabelRender1.svg‎

Lines changed: 4 additions & 4 deletions
Loading

‎__tests__/integration/snapshots/AxisLinearLabelRender2.svg‎

Lines changed: 4 additions & 4 deletions
Loading

‎__tests__/integration/snapshots/AxisLinearLabelRender3.svg‎

Lines changed: 4 additions & 4 deletions
Loading

‎src/ui/axis/guides/labels.ts‎

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -241,13 +241,6 @@ function renderLabel(
241241
...labelStyle,
242242
});
243243

244-
// For HTML labels, adjust x position to center align.
245-
if (label.nodeName === 'html') {
246-
const bbox = label.getBBox();
247-
const currentX = label.style.x || 0;
248-
label.attr('x', currentX - bbox.width / 2);
249-
}
250-
251244
container.attr(groupStyle);
252245
return label;
253246
}

0 commit comments

Comments
 (0)