File tree Expand file tree Collapse file tree 2 files changed +12
-1
lines changed
frontend/src/views/chat/component/charts Expand file tree Collapse file tree 2 files changed +12
-1
lines changed Original file line number Diff line number Diff line change @@ -113,6 +113,12 @@ export class Bar extends BaseG2Chart {
113113 }
114114 return `${ value } ${ _data . isPercent ? '%' : '' } `
115115 } ,
116+ position : ( data : any ) => {
117+ if ( data [ y [ 0 ] . value ] < 0 ) {
118+ return 'left'
119+ }
120+ return 'right'
121+ } ,
116122 transform : [
117123 { type : 'contrastReverse' } ,
118124 { type : 'exceedAdjust' } ,
Original file line number Diff line number Diff line change @@ -102,7 +102,12 @@ export class Column extends BaseG2Chart {
102102 }
103103 return `${ value } ${ _data . isPercent ? '%' : '' } `
104104 } ,
105- position : 'top' ,
105+ position : ( data : any ) => {
106+ if ( data [ y [ 0 ] . value ] < 0 ) {
107+ return 'bottom'
108+ }
109+ return 'top'
110+ } ,
106111 transform : [
107112 { type : 'contrastReverse' } ,
108113 { type : 'exceedAdjust' } ,
You can’t perform that action at this time.
0 commit comments