From 3ec6f912e9240e74d788d6ecb6ecd4f610597552 Mon Sep 17 00:00:00 2001 From: jianneng-fit2cloud Date: Tue, 26 Nov 2024 19:36:58 +0800 Subject: [PATCH] =?UTF-8?q?fix(=E5=9B=BE=E8=A1=A8):=20=E5=A0=86=E5=8F=A0?= =?UTF-8?q?=E6=8A=98=E7=BA=BF=E5=9B=BE=E5=8F=96=E6=B6=88=E6=9D=A1=E4=BB=B6?= =?UTF-8?q?=E6=A0=B7=E5=BC=8F=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../views/chart/components/js/panel/charts/line/area.ts | 8 +++----- .../views/chart/components/js/panel/common/common_antv.ts | 2 +- 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/core/core-frontend/src/views/chart/components/js/panel/charts/line/area.ts b/core/core-frontend/src/views/chart/components/js/panel/charts/line/area.ts index 18c155090c..20932bf19b 100644 --- a/core/core-frontend/src/views/chart/components/js/panel/charts/line/area.ts +++ b/core/core-frontend/src/views/chart/components/js/panel/charts/line/area.ts @@ -317,7 +317,6 @@ export class StackArea extends Area { } protected configLabel(chart: Chart, options: AreaOptions): AreaOptions { const { label: labelAttr, basicStyle } = parseJson(chart.customAttr) - const conditions = getLineConditions(chart) if (!labelAttr?.show) { return { ...options, @@ -341,10 +340,7 @@ export class StackArea extends Area { fill: labelAttr.color, fontSize: labelAttr.fontSize }, - formatter: function (param: Datum, point) { - point.color = - getLineLabelColorByCondition(conditions, param.value, point._origin.quotaList[0]) || - labelAttr.color + formatter: function (param: Datum) { return valueFormatter(param.value, labelAttr.labelFormatter) } } @@ -392,6 +388,8 @@ export class StackArea extends Area { ...this.baseOptions, isStack: true } + delete this.propertyInner.threshold + this.properties = this.properties.filter(item => item !== 'threshold') this.axis.push('extStack') } } diff --git a/core/core-frontend/src/views/chart/components/js/panel/common/common_antv.ts b/core/core-frontend/src/views/chart/components/js/panel/common/common_antv.ts index d6842b58be..6212518c4e 100644 --- a/core/core-frontend/src/views/chart/components/js/panel/common/common_antv.ts +++ b/core/core-frontend/src/views/chart/components/js/panel/common/common_antv.ts @@ -1346,7 +1346,7 @@ export const TOOLTIP_TPL = export function getConditions(chart: Chart) { const { threshold } = parseJson(chart.senior) const annotations = [] - if (!threshold.enable) return annotations + if (!threshold.enable || chart.type === 'area-stack') return annotations const conditions = threshold.lineThreshold ?? [] const yAxisIds = chart.yAxis.map(i => i.id) for (const field of conditions) {