File tree Expand file tree Collapse file tree 1 file changed +17
-4
lines changed
src/unfold/static/unfold/js Expand file tree Collapse file tree 1 file changed +17
-4
lines changed Original file line number Diff line number Diff line change @@ -446,9 +446,22 @@ const DEFAULT_CHART_OPTIONS = {
446446 width : 0 ,
447447 } ,
448448 ticks : {
449- display : false ,
450- font : {
451- size : 13 ,
449+ color : "#9ca3af" ,
450+ display : function ( context ) {
451+ return context . chart . data . datasets . some ( ( dataset ) => {
452+ return (
453+ dataset . hasOwnProperty ( "displayYAxis" ) && dataset . displayYAxis
454+ ) ;
455+ } ) ;
456+ } ,
457+ callback : function ( value ) {
458+ const suffix = this . chart . data . datasets . find (
459+ ( dataset ) => dataset . suffixYAxis
460+ ) ?. suffixYAxis ;
461+ if ( suffix ) {
462+ return `${ value } ${ suffix } ` ;
463+ }
464+ return value ;
452465 } ,
453466 } ,
454467 grid : {
@@ -521,7 +534,7 @@ const renderCharts = () => {
521534 new Chart ( ctx , {
522535 type : type || "bar" ,
523536 data : parsedData ,
524- options : options ? JSON . parse ( options ) : DEFAULT_CHART_OPTIONS ,
537+ options : options ? JSON . parse ( options ) : { ... DEFAULT_CHART_OPTIONS } ,
525538 } )
526539 ) ;
527540 }
You can’t perform that action at this time.
0 commit comments