fix(chart): use categorical axis for bar charts with numeric x-axis (#39141)

Co-authored-by: Enzo Martellucci <52219496+EnxDev@users.noreply.github.com>
(cherry picked from commit 171414f165)
This commit is contained in:
Jean Massucatto
2026-04-29 04:41:19 -03:00
committed by Michael S. Molina
parent 3159ec0356
commit 2f6254bfb4
4 changed files with 40 additions and 3 deletions

View File

@@ -1400,6 +1400,25 @@ test('getAxisType with forced categorical', () => {
);
});
test('getAxisType treats numeric as category for bar charts', () => {
expect(
getAxisType(
false,
false,
GenericDataType.Numeric,
EchartsTimeseriesSeriesType.Bar,
),
).toEqual(AxisType.Category);
expect(
getAxisType(
false,
false,
GenericDataType.Numeric,
EchartsTimeseriesSeriesType.Line,
),
).toEqual(AxisType.Value);
});
test('getMinAndMaxFromBounds returns empty object when not truncating', () => {
expect(
getMinAndMaxFromBounds(