mirror of
https://github.com/apache/superset.git
synced 2026-08-04 04:52:32 +00:00
fix(echarts): use scroll legend for horizontal layouts to prevent overlap (#36306)
(cherry picked from commit 33a425bbbc)
This commit is contained in:
@@ -437,15 +437,21 @@ export function getLegendProps(
|
||||
zoomable = false,
|
||||
legendState?: LegendState,
|
||||
padding?: LegendPaddingType,
|
||||
): LegendComponentOption | LegendComponentOption[] {
|
||||
const legend: LegendComponentOption | LegendComponentOption[] = {
|
||||
): LegendComponentOption {
|
||||
const isHorizontal =
|
||||
orientation === LegendOrientation.Top ||
|
||||
orientation === LegendOrientation.Bottom;
|
||||
|
||||
const effectiveType =
|
||||
type === LegendType.Scroll || !isHorizontal ? type : LegendType.Scroll;
|
||||
const legend: LegendComponentOption = {
|
||||
orient: [LegendOrientation.Top, LegendOrientation.Bottom].includes(
|
||||
orientation,
|
||||
)
|
||||
? 'horizontal'
|
||||
: 'vertical',
|
||||
show,
|
||||
type,
|
||||
type: effectiveType,
|
||||
selected: legendState,
|
||||
selector: ['all', 'inverse'],
|
||||
selectorLabel: {
|
||||
|
||||
Reference in New Issue
Block a user