mirror of
https://gh-proxy.org/https://github.com/klinsmaya/SQLBot.git
synced 2026-11-08 01:06:59 +08:00
feat: bar column label position
This commit is contained in:
@@ -113,6 +113,12 @@ export class Bar extends BaseG2Chart {
|
||||
}
|
||||
return `${value}${_data.isPercent ? '%' : ''}`
|
||||
},
|
||||
position: (data: any) => {
|
||||
if (data[y[0].value] < 0) {
|
||||
return 'left'
|
||||
}
|
||||
return 'right'
|
||||
},
|
||||
transform: [
|
||||
{ type: 'contrastReverse' },
|
||||
{ type: 'exceedAdjust' },
|
||||
|
||||
@@ -102,7 +102,12 @@ export class Column extends BaseG2Chart {
|
||||
}
|
||||
return `${value}${_data.isPercent ? '%' : ''}`
|
||||
},
|
||||
position: 'top',
|
||||
position: (data: any) => {
|
||||
if (data[y[0].value] < 0) {
|
||||
return 'bottom'
|
||||
}
|
||||
return 'top'
|
||||
},
|
||||
transform: [
|
||||
{ type: 'contrastReverse' },
|
||||
{ type: 'exceedAdjust' },
|
||||
|
||||
Reference in New Issue
Block a user