Skip to content

Commit a6e41ad

Browse files
committed
fix(chart): align legend with chart grid in List mode for Top/Bottom orientations
1 parent d123249 commit a6e41ad

2 files changed

Lines changed: 7 additions & 1 deletion

File tree

superset-frontend/plugins/plugin-chart-echarts/src/controls.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ const legendTypeControl: ControlSetItem = {
6767
label: t('Type'),
6868
choices: [
6969
['scroll', t('Scroll')],
70-
['plain', t('Plain')],
70+
['plain', t('List')],
7171
],
7272
default: legendType,
7373
renderTrigger: true,

superset-frontend/plugins/plugin-chart-echarts/src/utils/series.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -482,8 +482,14 @@ export function getLegendProps(
482482
break;
483483
case LegendOrientation.Bottom:
484484
legend.bottom = 0;
485+
if (padding?.left) {
486+
legend.left = padding.left;
487+
}
485488
break;
486489
case LegendOrientation.Top:
490+
if (padding?.left) {
491+
legend.left = padding.left;
492+
}
487493
default:
488494
legend.top = 0;
489495
legend.right = zoomable ? TIMESERIES_CONSTANTS.legendTopRightOffset : 0;

0 commit comments

Comments
 (0)