Merge pull request #10534 from ulleo/dev-v2

fix(图表): 去除柱线组合图空值处理的'隐藏空值'选项
This commit is contained in:
ulleo 2024-06-26 16:41:41 +08:00 committed by GitHub
commit 522b88458d
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 15 additions and 1 deletions

View File

@ -54,7 +54,10 @@ const init = () => {
}
}
const showIgnoreOption = computed(() => {
return !equalsAny(props.chart.type, 'table-pivot', 'table-info', 'indicator')
return !(
equalsAny(props.chart.type, 'table-pivot', 'table-info', 'indicator') ||
props.chart.type.includes('chart-mix')
)
})
const showEmptyDataFieldCtrl = computed(() => {

View File

@ -273,6 +273,17 @@ export class ColumnLineMix extends G2PlotChartView<DualAxesOptions, DualAxes> {
return tempOption
}
setupDefaultOptions(chart: ChartObj): ChartObj {
const { customAttr, senior } = chart
if (
senior.functionCfg.emptyDataStrategy == undefined ||
senior.functionCfg.emptyDataStrategy === 'ignoreData'
) {
senior.functionCfg.emptyDataStrategy = 'breakLine'
}
return chart
}
protected configCustomColors(chart: Chart, options: DualAxesOptions): DualAxesOptions {
const basicStyle = parseJson(chart.customAttr).basicStyle
const color = basicStyle.colors.map(item => hexColorToRGBA(item, basicStyle.alpha))