From 88c2f778e98ed2db7271309c7aae650cfc1abda6 Mon Sep 17 00:00:00 2001 From: wisonic-s Date: Wed, 19 Nov 2025 15:18:52 +0800 Subject: [PATCH] =?UTF-8?q?fix(=E5=9B=BE=E8=A1=A8):=20=E4=BF=AE=E5=A4=8D?= =?UTF-8?q?=E7=BA=BF=E9=9D=A2=E5=9B=BE=E8=BE=85=E5=8A=A9=E7=BA=BF=E6=A0=87?= =?UTF-8?q?=E7=AD=BE=E9=81=AE=E6=8C=A1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../chart/components/js/panel/charts/g2/line/area.ts | 8 +++++--- .../chart/components/js/panel/charts/g2/line/line.ts | 4 +++- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/core/core-frontend/src/views/chart/components/js/panel/charts/g2/line/area.ts b/core/core-frontend/src/views/chart/components/js/panel/charts/g2/line/area.ts index 6c074ffee5..e1113dfe60 100644 --- a/core/core-frontend/src/views/chart/components/js/panel/charts/g2/line/area.ts +++ b/core/core-frontend/src/views/chart/components/js/panel/charts/g2/line/area.ts @@ -82,10 +82,10 @@ export class Area extends G2ChartView { type: 'area', tooltip: false, style: { fillOpacity: 0.3 }, - zIndex: 1 + zIndex: -1 }, - { type: 'line', encode: { series: 'category' }, zIndex: 0 }, - { type: 'point', tooltip: false, zIndex: 2 } + { type: 'line', encode: { series: 'category' }, zIndex: -2 }, + { type: 'point', tooltip: false, zIndex: 0 } ] } EMPTY_MARKER = () => [] @@ -492,6 +492,7 @@ export class Area extends G2ChartView { type: 'lineY', encode: { y: 'value', color: () => randomAssistColorScale }, data: lineData, + zIndex: 0, style: { stroke: d => d.color, lineDash: d => (d.lineType === 'solid' ? [] : d.lineType === 'dashed' ? [10, 8] : [1, 2]), @@ -927,6 +928,7 @@ export class StackArea extends Area { type: 'lineY', encode: { y: 'value', color: () => randomAssistColorScale }, data: [line], + zIndex: 0, style: { stroke: line.color, lineDash: diff --git a/core/core-frontend/src/views/chart/components/js/panel/charts/g2/line/line.ts b/core/core-frontend/src/views/chart/components/js/panel/charts/g2/line/line.ts index 118797df9b..8cd104354d 100644 --- a/core/core-frontend/src/views/chart/components/js/panel/charts/g2/line/line.ts +++ b/core/core-frontend/src/views/chart/components/js/panel/charts/g2/line/line.ts @@ -97,6 +97,7 @@ export class Line extends G2ChartView { }, children: [ { + zIndex: -1, type: 'line', encode: { series: 'category' }, interaction: { @@ -110,7 +111,7 @@ export class Line extends G2ChartView { } } }, - { type: 'point', tooltip: false } + { type: 'point', tooltip: false, zIndex: 0 } ] } const options = this.setupOptions(chart, initOptions) @@ -575,6 +576,7 @@ export class Line extends G2ChartView { const randomAssistColorScale = randomString(6) const assistLineMark: G2Spec = { type: 'lineY', + zIndex: 0, encode: { y: 'value', color: () => randomAssistColorScale }, data: lineData, style: {