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 {
|
protected configLabel(chart: Chart, options: AreaOptions): AreaOptions {
|
||||||
const { label: labelAttr, basicStyle } = parseJson(chart.customAttr)
|
const { label: labelAttr, basicStyle } = parseJson(chart.customAttr)
|
||||||
const conditions = getLineConditions(chart)
|
|
||||||
if (!labelAttr?.show) {
|
if (!labelAttr?.show) {
|
||||||
return {
|
return {
|
||||||
...options,
|
...options,
|
||||||
@ -341,10 +340,7 @@ export class StackArea extends Area {
|
|||||||
fill: labelAttr.color,
|
fill: labelAttr.color,
|
||||||
fontSize: labelAttr.fontSize
|
fontSize: labelAttr.fontSize
|
||||||
},
|
},
|
||||||
formatter: function (param: Datum, point) {
|
formatter: function (param: Datum) {
|
||||||
point.color =
|
|
||||||
getLineLabelColorByCondition(conditions, param.value, point._origin.quotaList[0]) ||
|
|
||||||
labelAttr.color
|
|
||||||
return valueFormatter(param.value, labelAttr.labelFormatter)
|
return valueFormatter(param.value, labelAttr.labelFormatter)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -392,6 +388,8 @@ export class StackArea extends Area {
|
|||||||
...this.baseOptions,
|
...this.baseOptions,
|
||||||
isStack: true
|
isStack: true
|
||||||
}
|
}
|
||||||
|
delete this.propertyInner.threshold
|
||||||
|
this.properties = this.properties.filter(item => item !== 'threshold')
|
||||||
this.axis.push('extStack')
|
this.axis.push('extStack')
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1346,7 +1346,7 @@ export const TOOLTIP_TPL =
|
|||||||
export function getConditions(chart: Chart) {
|
export function getConditions(chart: Chart) {
|
||||||
const { threshold } = parseJson(chart.senior)
|
const { threshold } = parseJson(chart.senior)
|
||||||
const annotations = []
|
const annotations = []
|
||||||
if (!threshold.enable) return annotations
|
if (!threshold.enable || chart.type === 'area-stack') return annotations
|
||||||
const conditions = threshold.lineThreshold ?? []
|
const conditions = threshold.lineThreshold ?? []
|
||||||
const yAxisIds = chart.yAxis.map(i => i.id)
|
const yAxisIds = chart.yAxis.map(i => i.id)
|
||||||
for (const field of conditions) {
|
for (const field of conditions) {
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user