File tree Expand file tree Collapse file tree 2 files changed +6
-4
lines changed Expand file tree Collapse file tree 2 files changed +6
-4
lines changed Original file line number Diff line number Diff line change 1
1
{
2
2
"name" : " @netdata/charts" ,
3
- "version" : " 5.6.2 " ,
3
+ "version" : " 5.6.3 " ,
4
4
"description" : " Netdata frontend SDK and chart utilities" ,
5
5
"main" : " dist/index.js" ,
6
6
"module" : " dist/es6/index.js" ,
Original file line number Diff line number Diff line change @@ -161,14 +161,16 @@ export default (chart, sdk) => {
161
161
}
162
162
163
163
const getNextColor = ( ) => {
164
- const colorsAttribute = chart . getAttribute ( "colors" )
164
+ const colorsAttribute = chart . getAttribute ( "colors" ) || [ ]
165
165
const index = colorCursor ++ % ( colorsAttribute . length + dimensionColors . length )
166
166
167
167
const nextColor =
168
168
index < colorsAttribute . length
169
169
? typeof colorsAttribute [ index ] === "number"
170
170
? dimensionColors [ colorsAttribute [ index ] ]
171
- : colorsAttribute [ index ]
171
+ : ! colorsAttribute [ index ]
172
+ ? dimensionColors [ index ]
173
+ : colorsAttribute [ index ]
172
174
: dimensionColors [ index - colorsAttribute . length ]
173
175
174
176
return nextColor
@@ -237,7 +239,7 @@ export default (chart, sdk) => {
237
239
const key = getMemKey ( )
238
240
const colorsAttr = chart . getAttribute ( "colors" )
239
241
const sparkline = chart . isSparkline ( )
240
- if ( sparkline && colorsAttr && colorsAttr . length === 1 ) return colorsAttr [ 0 ]
242
+ if ( sparkline && Array . isArray ( colorsAttr ) ) return colorsAttr [ 0 ]
241
243
242
244
const isSelected = id === "selected"
243
245
id = ! id || isSelected ? chart . getAttribute ( "selectedDimensions" ) [ 0 ] || id : id
You can’t perform that action at this time.
0 commit comments