File tree Expand file tree Collapse file tree 1 file changed +11
-1
lines changed
src/unfold/static/unfold/js Expand file tree Collapse file tree 1 file changed +11
-1
lines changed Original file line number Diff line number Diff line change @@ -533,7 +533,17 @@ const renderCharts = () => {
533533 for ( const key in parsedData . datasets ) {
534534 const dataset = parsedData . datasets [ key ] ;
535535 const processColor = ( colorProp ) => {
536- if ( dataset ?. [ colorProp ] ?. startsWith ( "var(" ) ) {
536+ if ( Array . isArray ( dataset ?. [ colorProp ] ) ) {
537+ for ( const [ index , prop ] of dataset ?. [ colorProp ] . entries ( ) ) {
538+ if ( prop . startsWith ( "var(" ) ) {
539+ const cssVar = prop . match ( / v a r \( ( .* ?) \) / ) [ 1 ] ;
540+ const color = getComputedStyle ( document . documentElement )
541+ . getPropertyValue ( cssVar )
542+ . trim ( ) ;
543+ dataset [ colorProp ] [ index ] = color ;
544+ }
545+ }
546+ } else if ( dataset ?. [ colorProp ] ?. startsWith ( "var(" ) ) {
537547 const cssVar = dataset [ colorProp ] . match ( / v a r \( ( .* ?) \) / ) [ 1 ] ;
538548 const color = getComputedStyle ( document . documentElement )
539549 . getPropertyValue ( cssVar )
You can’t perform that action at this time.
0 commit comments