File tree Expand file tree Collapse file tree 3 files changed +21
-3
lines changed
frontend/src/views/chat/component/charts Expand file tree Collapse file tree 3 files changed +21
-3
lines changed Original file line number Diff line number Diff line change @@ -106,7 +106,13 @@ export class Bar extends BaseG2Chart {
106106 } ,
107107 labels : [
108108 {
109- text : ( data : any ) => `${ data [ y [ 0 ] . value ] } ${ _data . isPercent ? '%' : '' } ` ,
109+ text : ( data : any ) => {
110+ const value = data [ y [ 0 ] . value ]
111+ if ( value === undefined || value === null ) {
112+ return ''
113+ }
114+ return `${ value } ${ _data . isPercent ? '%' : '' } `
115+ } ,
110116 transform : [
111117 { type : 'contrastReverse' } ,
112118 { type : 'exceedAdjust' } ,
Original file line number Diff line number Diff line change @@ -95,7 +95,13 @@ export class Column extends BaseG2Chart {
9595 } ,
9696 labels : [
9797 {
98- text : ( data : any ) => `${ data [ y [ 0 ] . value ] } ${ _data . isPercent ? '%' : '' } ` ,
98+ text : ( data : any ) => {
99+ const value = data [ y [ 0 ] . value ]
100+ if ( value === undefined || value === null ) {
101+ return ''
102+ }
103+ return `${ value } ${ _data . isPercent ? '%' : '' } `
104+ } ,
99105 position : 'top' ,
100106 transform : [
101107 { type : 'contrastReverse' } ,
Original file line number Diff line number Diff line change @@ -61,7 +61,13 @@ export class Line extends BaseG2Chart {
6161 } ,
6262 labels : [
6363 {
64- text : ( data : any ) => `${ data [ y [ 0 ] . value ] } ${ _data . isPercent ? '%' : '' } ` ,
64+ text : ( data : any ) => {
65+ const value = data [ y [ 0 ] . value ]
66+ if ( value === undefined || value === null ) {
67+ return ''
68+ }
69+ return `${ value } ${ _data . isPercent ? '%' : '' } `
70+ } ,
6571 style : {
6672 dx : - 10 ,
6773 dy : - 12 ,
You can’t perform that action at this time.
0 commit comments