@@ -3,13 +3,7 @@ import React, { useEffect } from 'react';
33import { NoDrawableDataErrorMessage } from '../../component/editor/CodeViewerComponent' ;
44import { evaluateRulesOnDict , useStyleRules } from '../../extensions/styling/StyleRuleEvaluator' ;
55import { ChartProps } from '../Chart' ;
6- import {
7- convertRecordObjectToString ,
8- mutateName ,
9- processHierarchyFromRecords ,
10- recordToNative ,
11- toNumber ,
12- } from '../ChartUtils' ;
6+ import { recordToNative , toNumber } from '../ChartUtils' ;
137import { themeNivo } from '../Utils' ;
148import { extensionEnabled } from '../../utils/ReportUtils' ;
159
@@ -77,17 +71,18 @@ const NeoLineChart = (props: ChartProps) => {
7771 // For line charts, the line color is overridden if at least one value meets the criteria.
7872 const getLineColors = ( line ) => {
7973 const xFieldName = props . selection && props . selection . x ;
80- const yFieldName = line . id && line . id . split ( '(' ) [ 1 ] && line . id . split ( '(' ) [ 1 ] . split ( ')' ) [ 0 ] ;
74+ const yFieldName = line . id ;
8175 let color = 'black' ;
82- line . data . forEach ( ( entry ) => {
76+ for ( const entry of line . data ) {
8377 const data = { } ;
84- data [ xFieldName ] = entry [ selection . x ] ;
85- data [ yFieldName ] = entry [ selection . value ] ;
78+ data [ xFieldName ] = entry . x ;
79+ data [ yFieldName ] = entry . y ;
8680 const validRuleIndex = evaluateRulesOnDict ( data , styleRules , [ 'line color' ] ) ;
8781 if ( validRuleIndex !== - 1 ) {
8882 color = styleRules [ validRuleIndex ] . customizationValue ;
83+ break ;
8984 }
90- } ) ;
85+ }
9186 return color ;
9287 } ;
9388
0 commit comments