mirror of
https://github.com/apache/superset.git
synced 2026-04-18 07:35:09 +00:00
fix(charts): Hide Values greater than Max Y Axis Bound on Mixed Time Series with Bar series (#21015)
* Mixed TimeSeries: - When Bar chart is used as serie type, we need to hide values that are greater than the max Y Axis Bound. * Mixed Time Series: - Simplify logic for getOverMaxHiddenFormatter * Mixed Time Series: - Add tests for new getOverMaxHiddenFormatter util func
This commit is contained in:
committed by
GitHub
parent
d44202f03c
commit
bdcc0a9bcf
@@ -26,6 +26,7 @@ import {
|
||||
getLegendProps,
|
||||
sanitizeHtml,
|
||||
extractShowValueIndexes,
|
||||
getOverMaxHiddenFormatter,
|
||||
} from '../../src/utils/series';
|
||||
import { LegendOrientation, LegendType } from '../../src/types';
|
||||
import { defaultLegendPadding } from '../../src/defaults';
|
||||
@@ -536,4 +537,16 @@ describe('formatSeriesName', () => {
|
||||
expect(sanitizeHtml(NULL_STRING)).toEqual('<NULL>');
|
||||
});
|
||||
});
|
||||
|
||||
describe('getOverMaxHiddenFormatter', () => {
|
||||
it('should hide value if greater than max', () => {
|
||||
const formatter = getOverMaxHiddenFormatter({ max: 81000 });
|
||||
expect(formatter.format(84500)).toEqual('');
|
||||
});
|
||||
it('should show value if less or equal than max', () => {
|
||||
const formatter = getOverMaxHiddenFormatter({ max: 81000 });
|
||||
expect(formatter.format(81000)).toEqual('81000');
|
||||
expect(formatter.format(50000)).toEqual('50000');
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user