File tree Expand file tree Collapse file tree 1 file changed +8
-1
lines changed Expand file tree Collapse file tree 1 file changed +8
-1
lines changed Original file line number Diff line number Diff line change @@ -159,7 +159,14 @@ export const generateSeriesToColorHex = (
159159 const cgMap = { ...columnGroupMap }
160160 cgMap . mappings . forEach ( ( graphLine , colorIndex ) => {
161161 const id = getSeriesId ( graphLine , columnGroupMap . columnKeys )
162- const colors = properties . colors ?? DEFAULT_LINE_COLORS
162+ let colors
163+ if ( Array . isArray ( properties . colors ) && properties . colors . length ) {
164+ // takes care of when properties.colors is NOT undefined, and NOT an empty array
165+ colors = properties . colors
166+ } else {
167+ // when array is undefined or array IS empty.
168+ colors = DEFAULT_LINE_COLORS
169+ }
163170 const colorsHexArray = colors . map ( value => value . hex )
164171 const fillScale = getNominalColorScale ( columnGroupMap , colorsHexArray )
165172 seriesToColorHex [ id ] = fillScale ( colorIndex )
You can’t perform that action at this time.
0 commit comments