fix: Bar charts horizontal margin adjustment error (#26817)

This commit is contained in:
Michael S. Molina
2024-01-29 15:25:16 -05:00
committed by GitHub
parent 8db5d13749
commit 84c48d11d8
4 changed files with 72 additions and 17 deletions

View File

@@ -795,6 +795,14 @@ describe('getChartPadding', () => {
right: 0,
top: 0,
});
expect(
getChartPadding(true, LegendOrientation.Left, 100, undefined, true),
).toEqual({
bottom: 100,
left: 0,
right: 0,
top: 0,
});
});
it('should return the correct padding for right orientation', () => {
@@ -804,6 +812,14 @@ describe('getChartPadding', () => {
right: 50,
top: 0,
});
expect(
getChartPadding(true, LegendOrientation.Right, 50, undefined, true),
).toEqual({
bottom: 0,
left: 0,
right: 50,
top: 0,
});
});
it('should return the correct padding for top orientation', () => {
@@ -813,6 +829,14 @@ describe('getChartPadding', () => {
right: 0,
top: 20,
});
expect(
getChartPadding(true, LegendOrientation.Top, 20, undefined, true),
).toEqual({
bottom: 0,
left: 0,
right: 0,
top: 20,
});
});
it('should return the correct padding for bottom orientation', () => {
@@ -822,6 +846,14 @@ describe('getChartPadding', () => {
right: 0,
top: 0,
});
expect(
getChartPadding(true, LegendOrientation.Bottom, 10, undefined, true),
).toEqual({
bottom: 0,
left: 10,
right: 0,
top: 0,
});
});
});