Skip to content

Commit 28fe3cc

Browse files
committed
use reversed stacks by default
1 parent 44163b8 commit 28fe3cc

File tree

4 files changed

+5
-3
lines changed

4 files changed

+5
-3
lines changed

src/core/chart-core.tsx

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -253,6 +253,9 @@ export function InternalCoreChart({
253253
title: axisTitle(yAxisOptions.title ?? {}, inverted || verticalAxisTitlePlacement === "side"),
254254
labels: axisLabels(yAxisOptions.labels ?? {}),
255255
plotLines: yAxisPlotLines(yAxisOptions.plotLines, emphasizeBaseline),
256+
// We use reversed stack by default so that the order of points in the tooltip and series in the legend
257+
// correspond the order of stacks.
258+
reversedStacks: yAxisOptions.reversedStacks ?? true,
256259
})),
257260
// We don't use Highcharts tooltip, but certain tooltip options such as tooltip.snap or tooltip.shared
258261
// affect the hovering behavior of Highcharts. That is only the case when the tooltip is not disabled,

src/core/components/core-filters.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@ function ChartSeriesFilter({ api, i18nStrings }: { api: ChartAPI; i18nStrings?:
4747
i18nStrings={{
4848
filterLabel: i18n("i18nStrings.filterLabel", i18nStrings?.seriesFilterLabel),
4949
filterPlaceholder: i18n("i18nStrings.filterPlaceholder", i18nStrings?.seriesFilterPlaceholder),
50+
filterSelectedAriaLabel: i18nStrings?.seriesFilterSelectedAriaLabel,
5051
}}
5152
/>
5253
);

src/core/components/core-tooltip.tsx

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -174,9 +174,6 @@ function getTooltipContentCartesian(
174174
) : null),
175175
};
176176
});
177-
if (chart.options.plotOptions?.series?.stacking) {
178-
detailItems.reverse();
179-
}
180177
const titleFormatter = getFormatter(chart.xAxis[0]);
181178
const slotRenderProps: TooltipSlotProps = { x, items: matchedItems };
182179
return {

src/core/interfaces.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -106,6 +106,7 @@ export interface BaseI18nStrings {
106106
recoveryText?: string;
107107
seriesFilterLabel?: string;
108108
seriesFilterPlaceholder?: string;
109+
seriesFilterSelectedAriaLabel?: string;
109110
legendAriaLabel?: string;
110111
detailPopoverDismissAriaLabel?: string;
111112
}

0 commit comments

Comments
 (0)