mirror of
https://github.com/apache/superset.git
synced 2026-05-12 11:25:56 +00:00
fix(chart): use categorical axis for bar charts with numeric x-axis (#39141)
Co-authored-by: Enzo Martellucci <52219496+EnxDev@users.noreply.github.com>
This commit is contained in:
@@ -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(
|
||||
|
||||
Reference in New Issue
Block a user