Skip to content

Commit 7528269

Browse files
authored
fix: Fine tune error bar marker color (#59)
1 parent 094f03b commit 7528269

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/cartesian-chart/chart-series-cartesian.tsx

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@
33

44
import type Highcharts from "highcharts";
55

6+
import { colorChartsErrorBarMarker } from "@cloudscape-design/design-tokens";
7+
68
import { PointDataItemType, RangeDataItemOptions } from "../core/interfaces";
79
import { createThresholdMetadata, getOptionsId } from "../core/utils";
810
import * as Styles from "../internal/chart-styles";
@@ -46,9 +48,10 @@ export const transformCartesianSeries = (
4648
return { type: "line", id: s.id, name: s.name, data, custom, enableMouseTracking, ...style };
4749
}
4850
if (s.type === "errorbar") {
51+
const color = s.color ?? colorChartsErrorBarMarker;
4952
// In Highcharts, the error-bar series graphic color is represented as stem-, and whisker colors.
5053
// We simplify that, and only expose a single color prop that sets both of those.
51-
const colors = s.color ? { stemColor: s.color, whiskerColor: s.color } : {};
54+
const colors = { stemColor: color, whiskerColor: color };
5255
return { ...s, data: s.data as Writeable<RangeDataItemOptions[]>, ...colors };
5356
}
5457
return { ...s, data: s.data as Writeable<PointDataItemType[]> };

0 commit comments

Comments
 (0)