Skip to content

Commit 53e5fe1

Browse files
committed
fix: address comments
1 parent a45aa42 commit 53e5fe1

File tree

2 files changed

+2
-5
lines changed

2 files changed

+2
-5
lines changed

projects/observability/src/shared/components/cartesian/cartesian-chart.component.ts

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -175,10 +175,7 @@ export class CartesianChartComponent<TData> implements OnChanges, OnDestroy {
175175
label: singleValue.context.name,
176176
value: defaultYDataAccessor<number | string>(singleValue.dataPoint),
177177
units: singleValue.context.units,
178-
color:
179-
singleValue.context.getColor !== undefined
180-
? singleValue.context.getColor(singleValue.dataPoint)
181-
: singleValue.context.color
178+
color: singleValue.context.getColor?.(singleValue.dataPoint) ?? singleValue.context.color
182179
}))
183180
};
184181
}

projects/observability/src/shared/components/cartesian/d3/data/series/cartesian-column.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ export class CartesianColumn<TData> extends CartesianSeries<TData> {
4343
}
4444

4545
private getColorForDatum(datum: TData): string {
46-
return this.series.getColor ? this.series.getColor(datum) : this.series.color;
46+
return this.series.getColor?.(datum) ?? this.series.color;
4747
}
4848

4949
protected buildMultiAxisDataLookupStrategy(): MouseDataLookupStrategy<TData, Series<TData>> {

0 commit comments

Comments
 (0)