fix(echarts): use scroll legend for horizontal layouts to prevent overlap (#36306)

This commit is contained in:
Yousuf Ansari
2025-12-18 00:46:35 +05:30
committed by GitHub
parent 5ce4c52cfa
commit 33a425bbbc
3 changed files with 24 additions and 6 deletions

View File

@@ -891,14 +891,27 @@ describe('getLegendProps', () => {
});
});
it('should return the correct props for plain type with bottom orientation', () => {
it('should default plain legends to scroll for bottom orientation', () => {
expect(
getLegendProps(LegendType.Plain, LegendOrientation.Bottom, false, theme),
).toEqual({
show: false,
bottom: 0,
orient: 'horizontal',
type: 'plain',
type: 'scroll',
...expectedThemeProps,
});
});
it('should default plain legends to scroll for top orientation', () => {
expect(
getLegendProps(LegendType.Plain, LegendOrientation.Top, false, theme),
).toEqual({
show: false,
top: 0,
right: 0,
orient: 'horizontal',
type: 'scroll',
...expectedThemeProps,
});
});