File tree Expand file tree Collapse file tree 1 file changed +5
-3
lines changed Expand file tree Collapse file tree 1 file changed +5
-3
lines changed Original file line number Diff line number Diff line change @@ -168,23 +168,25 @@ const NeoBarChart = (props: ChartProps) => {
168168 const chartColorsByScheme = getD3ColorsByScheme ( colorScheme ) ;
169169 // Compute bar color based on rules - overrides default color scheme completely.
170170 const getBarColor = ( bar ) => {
171- let { id } = bar ;
172- let colorIndex = keys . indexOf ( id ) ;
171+ let { index : colorIndex } = bar ;
173172 if ( colorIndex >= chartColorsByScheme . length ) {
174173 colorIndex %= chartColorsByScheme . length ;
175174 }
176175
177- const dict = { } ;
178176 if ( ! props . selection ) {
179177 return chartColorsByScheme [ colorIndex ] ;
180178 }
179+
180+ const dict = { } ;
181181 dict [ selection . index ] = bar . indexValue ;
182182 dict [ selection . value ] = bar . value ;
183183 dict [ selection . key ] = bar . id ;
184+
184185 const validRuleIndex = evaluateRulesOnDict ( dict , styleRules , [ 'bar color' ] ) ;
185186 if ( validRuleIndex !== - 1 ) {
186187 return styleRules [ validRuleIndex ] . customizationValue ;
187188 }
189+
188190 return chartColorsByScheme [ colorIndex ] ;
189191 } ;
190192
You can’t perform that action at this time.
0 commit comments