1- const { checkIsPercent, getAxesWithFilter, processMultiQuotaData } = require ( './utils' )
1+ const { checkIsPercent, formatNumber , getAxesWithFilter, processMultiQuotaData } = require ( './utils' )
22
33function getLineOptions ( baseOptions , axis , data ) {
44
@@ -51,7 +51,12 @@ function getLineOptions(baseOptions, axis, data) {
5151 labelAutoWrap : true ,
5252 labelAutoEllipsis : true ,
5353 } ,
54- y : { title : y [ 0 ] . name } ,
54+ y : {
55+ title : y [ 0 ] . name ,
56+ labelFormatter : ( value ) => {
57+ return String ( formatNumber ( value ) )
58+ } ,
59+ } ,
5560 } ,
5661 scale : {
5762 x : {
@@ -75,7 +80,7 @@ function getLineOptions(baseOptions, axis, data) {
7580 if ( value === undefined || value === null ) {
7681 return ''
7782 }
78- return `${ value } ${ _data . isPercent ? '%' : '' } `
83+ return `${ formatNumber ( value ) } ${ _data . isPercent ? '%' : '' } `
7984 } ,
8085 style : {
8186 dx : - 10 ,
@@ -92,10 +97,10 @@ function getLineOptions(baseOptions, axis, data) {
9297 if ( series . length > 0 ) {
9398 return {
9499 name : data [ series [ 0 ] . value ] ,
95- value : `${ data [ y [ 0 ] . value ] } ${ _data . isPercent ? '%' : '' } ` ,
100+ value : `${ formatNumber ( data [ y [ 0 ] . value ] ) } ${ _data . isPercent ? '%' : '' } ` ,
96101 }
97102 } else {
98- return { name : y [ 0 ] . name , value : `${ data [ y [ 0 ] . value ] } ${ _data . isPercent ? '%' : '' } ` }
103+ return { name : y [ 0 ] . name , value : `${ formatNumber ( data [ y [ 0 ] . value ] ) } ${ _data . isPercent ? '%' : '' } ` }
99104 }
100105 } ,
101106 } ,
0 commit comments