Merge pull request #13581 from dataease/pr@dev-v2@chart-stack-area-fix
fix(图表): 堆叠折线图取消条件样式功能
This commit is contained in:
commit
80a6835901
@ -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')
|
||||
}
|
||||
}
|
||||
|
||||
@ -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) {
|
||||
|
||||
Loading…
Reference in New Issue
Block a user