Skip to content

Commit a4d3a4d

Browse files
committed
support LKS saved config with multiple y-axis measures (only use first)
1 parent bdc6e00 commit a4d3a4d

1 file changed

Lines changed: 5 additions & 4 deletions

File tree

packages/components/src/internal/components/chart/ChartBuilderModal.tsx

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -646,10 +646,11 @@ export const ChartBuilderModal: FC<ChartBuilderModalProps> = memo(({ actions, mo
646646
}
647647

648648
// handle bar chart aggregate method and error bars
649-
if (measures.y?.aggregate) {
650-
fieldValues_[BAR_CHART_AGGREGATE_NAME] = { ...measures.y.aggregate };
651-
if (measures.y.errorBars) {
652-
fieldValues_[BAR_CHART_ERROR_BAR_NAME] = { value: measures.y.errorBars };
649+
const y = Utils.isArray(measures.y) ? measures.y[0] : measures.y;
650+
if (y?.aggregate) {
651+
fieldValues_[BAR_CHART_AGGREGATE_NAME] = Utils.isObject(y.aggregate) ? { ...y.aggregate } : { value: y.aggregate };
652+
if (y.errorBars) {
653+
fieldValues_[BAR_CHART_ERROR_BAR_NAME] = { value: y.errorBars };
653654
}
654655
}
655656

0 commit comments

Comments
 (0)