You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Margin setting for legened doesn't work in mixed charts #35029
Although this bug is closed, I encounter it in this version Version: 4.1.1, legend indent setting does not work in mixed chart, orientation and type settings work, when changing legend indent nothing changes, everything stays in place, although legend indent is applied to other charts
Example of a bar chart without legend margin:
Example of a bar chart with legend margin:
Here the legend margin works, then an example of a mixed diagram:
As you can see from the screenshots, the legend margin does not work for mixed chart.
Superset version
4.1.3
Python version
3.9
Node version
16
Browser
Chrome
Additional context
From the frontend side, the code in control.tsx looks like this:
Hi @saha23412! I'm Dosu and I’m helping the superset team.
The legend margin setting is not currently applied in mixed charts (MixedTimeseries) due to missing or inconsistent handling in the chart's configuration logic. While legend orientation and type work, the margin setting is not propagated or respected in the mixed chart's option building, unlike in bar or pie charts where recent improvements have been made for legend positioning and margin handling. Recent updates have focused on legend sorting and display, but not on margin or spacing for mixed charts, so this limitation still exists in Superset 4.1.3. You may want to watch for future updates or consider custom code changes if legend margin is critical for your use case.
Relevant details: PR #34911, PR #34435, PR #35005.
Thanks, I fixed the code block in the file superset-frontend/plugins/plugin-chart-echarts/src/MixedTimeseries/transformProps.ts where null was passed instead of legend margin
Activity
dosubot commentedon Sep 5, 2025
Hi @saha23412! I'm Dosu and I’m helping the superset team.
The legend margin setting is not currently applied in mixed charts (MixedTimeseries) due to missing or inconsistent handling in the chart's configuration logic. While legend orientation and type work, the margin setting is not propagated or respected in the mixed chart's option building, unlike in bar or pie charts where recent improvements have been made for legend positioning and margin handling. Recent updates have focused on legend sorting and display, but not on margin or spacing for mixed charts, so this limitation still exists in Superset 4.1.3. You may want to watch for future updates or consider custom code changes if legend margin is critical for your use case.
Relevant details: PR #34911, PR #34435, PR #35005.
To reply, just mention @dosu.
Share context across your team and agents. Try Dosu.
msyavuz commentedon Sep 5, 2025
Hey, @saha23412 Does the mentioned pr #34911 fix this? You can test that on master branch.
SBIN2010 commentedon Sep 5, 2025
Hi @msyavuz pr #34911 just adds legend sorting
Margin legends is indeed missing from MixedTimeseries chart
saha23412 commentedon Sep 8, 2025
Thanks, I fixed the code block in the file superset-frontend/plugins/plugin-chart-echarts/src/MixedTimeseries/transformProps.ts where null was passed instead of legend margin
It was like that:
const chartPadding = getPadding( showLegend, legendOrientation, addYAxisTitleOffset, zoomable, null, addXAxisTitleOffset, yAxisTitlePosition, yAxisTitleCalculatedMargin, xAxisTitleCalculatedMargin, );Corrected to:
const chartPadding = getPadding( showLegend, legendOrientation, addYAxisTitleOffset, zoomable, legendMargin addXAxisTitleOffset, yAxisTitlePosition, yAxisTitleCalculatedMargin, xAxisTitleCalculatedMargin, );