From afc82855d877fbb5b33d4c18977c00d1e1c4b0c9 Mon Sep 17 00:00:00 2001 From: "lixuefei.1313" Date: Thu, 9 Oct 2025 15:27:49 +0800 Subject: [PATCH 1/2] fix: fix issue of markline will report an error when series has no data --- .../src/component/marker/mark-line/cartesian-mark-line.ts | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/packages/vchart/src/component/marker/mark-line/cartesian-mark-line.ts b/packages/vchart/src/component/marker/mark-line/cartesian-mark-line.ts index 7ca8390c6a..84d7d500b9 100644 --- a/packages/vchart/src/component/marker/mark-line/cartesian-mark-line.ts +++ b/packages/vchart/src/component/marker/mark-line/cartesian-mark-line.ts @@ -111,6 +111,10 @@ export class CartesianMarkLine extends BaseMarkLine { expandDistanceValue = expandDistance as number; } const { points, limitRect } = updateAttrs; + if (!points || points.length < 2) { + this._markerComponent?.setAttributes(updateAttrs); + return; + } const joinPoints = getInsertPoints( (points as IPoint[])[0], From ddd193d706a68c7a1f113523c6dbb73fda89cb3d Mon Sep 17 00:00:00 2001 From: "lixuefei.1313" Date: Thu, 9 Oct 2025 15:30:02 +0800 Subject: [PATCH 2/2] docs: update changlog of rush --- ...markline-when-series-no-data_2025-10-09-07-30.json | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100644 common/changes/@visactor/vchart/fix-fix-error-of-markline-when-series-no-data_2025-10-09-07-30.json diff --git a/common/changes/@visactor/vchart/fix-fix-error-of-markline-when-series-no-data_2025-10-09-07-30.json b/common/changes/@visactor/vchart/fix-fix-error-of-markline-when-series-no-data_2025-10-09-07-30.json new file mode 100644 index 0000000000..dc53f5fa6a --- /dev/null +++ b/common/changes/@visactor/vchart/fix-fix-error-of-markline-when-series-no-data_2025-10-09-07-30.json @@ -0,0 +1,11 @@ +{ + "changes": [ + { + "comment": "fix: fix issue of markline will report an error when series has no data\n\n", + "type": "none", + "packageName": "@visactor/vchart" + } + ], + "packageName": "@visactor/vchart", + "email": "lixuef1313@163.com" +} \ No newline at end of file