From 984e02a794b0bb9d68082c210d7f199f7af2669c Mon Sep 17 00:00:00 2001 From: xiaoluoHe Date: Mon, 16 Dec 2024 14:21:02 +0800 Subject: [PATCH 1/2] fix: line axis label flush when has background --- packages/vrender-components/src/axis/line.ts | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/packages/vrender-components/src/axis/line.ts b/packages/vrender-components/src/axis/line.ts index 7f19bd964..86a467978 100644 --- a/packages/vrender-components/src/axis/line.ts +++ b/packages/vrender-components/src/axis/line.ts @@ -433,8 +433,7 @@ export class LineAxis extends AxisBase { leftMostLabel.setAttributes({ dx: (leftMostLabel.attribute.dx ?? 0) + left - leftBound }); } else { leftMostLabel.setAttributes({ - x: left, - textAlign: 'left' + x: leftMostLabel.attribute.x + left - leftBound }); } } @@ -446,8 +445,7 @@ export class LineAxis extends AxisBase { rightMostLabel.setAttributes({ dx: (rightMostLabel.attribute.dx ?? 0) + right - rightBound }); } else { rightMostLabel.setAttributes({ - x: right, - textAlign: 'right' + x: rightMostLabel.attribute.x + right - rightBound }); } } @@ -469,8 +467,7 @@ export class LineAxis extends AxisBase { }); } else { topMostLabel.setAttributes({ - y: top, - textBaseline: 'top' + y: topMostLabel.attribute.y + top - topBound }); } } @@ -484,8 +481,7 @@ export class LineAxis extends AxisBase { }); } else { bottomMostLabel.setAttributes({ - y: bottom, - textBaseline: 'bottom' + y: bottomMostLabel.attribute.y + bottom - bottomBound }); } } From ef0e23b970ce68c57d73894886bc210ace49ac9e Mon Sep 17 00:00:00 2001 From: xiaoluoHe Date: Mon, 16 Dec 2024 14:22:55 +0800 Subject: [PATCH 2/2] docs: add changelog --- .../fix-line-label-flush_2024-12-16-06-22.json | 10 ++++++++++ 1 file changed, 10 insertions(+) create mode 100644 common/changes/@visactor/vrender-components/fix-line-label-flush_2024-12-16-06-22.json diff --git a/common/changes/@visactor/vrender-components/fix-line-label-flush_2024-12-16-06-22.json b/common/changes/@visactor/vrender-components/fix-line-label-flush_2024-12-16-06-22.json new file mode 100644 index 000000000..3b22d14ec --- /dev/null +++ b/common/changes/@visactor/vrender-components/fix-line-label-flush_2024-12-16-06-22.json @@ -0,0 +1,10 @@ +{ + "changes": [ + { + "packageName": "@visactor/vrender-components", + "comment": "fix: fix the incorrect flush effect with background axis labels", + "type": "none" + } + ], + "packageName": "@visactor/vrender-components" +} \ No newline at end of file