Merge pull request #13830 from dataease/pr@dev-v2@refactor_bar_negative_label

refactor(图表): 柱状图负值标签显示位置优化 #13172
This commit is contained in:
wisonic-s
2024-12-04 16:51:51 +08:00
committed by GitHub

View File

@@ -137,6 +137,17 @@ export class Bar extends G2PlotChartView<ColumnOptions, Column> {
}
})
return group
},
position: data => {
if (data.value < 0) {
if (tmpOptions.label?.position === 'top') {
return 'bottom'
}
if (tmpOptions.label?.position === 'bottom') {
return 'top'
}
}
return tmpOptions.label?.position
}
}
return {