Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion src/cartesian-chart/chart-series-cartesian.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@

import type Highcharts from "highcharts";

import { colorChartsErrorBarMarker } from "@cloudscape-design/design-tokens";

import { PointDataItemType, RangeDataItemOptions } from "../core/interfaces";
import { createThresholdMetadata, getOptionsId } from "../core/utils";
import * as Styles from "../internal/chart-styles";
Expand Down Expand Up @@ -46,9 +48,10 @@ export const transformCartesianSeries = (
return { type: "line", id: s.id, name: s.name, data, custom, enableMouseTracking, ...style };
}
if (s.type === "errorbar") {
const color = s.color ?? colorChartsErrorBarMarker;
// In Highcharts, the error-bar series graphic color is represented as stem-, and whisker colors.
// We simplify that, and only expose a single color prop that sets both of those.
const colors = s.color ? { stemColor: s.color, whiskerColor: s.color } : {};
const colors = { stemColor: color, whiskerColor: color };
return { ...s, data: s.data as Writeable<RangeDataItemOptions[]>, ...colors };
}
return { ...s, data: s.data as Writeable<PointDataItemType[]> };
Expand Down
Loading