refactor(图表): 柱状图负值标签显示位置优化 #13172

This commit is contained in:
wisonic
2024-12-04 16:49:54 +08:00
parent 6a5dcc66d8
commit 1bedcd0107

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 {