Bug description
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:
const legendMarginControl: ControlSetItem = { name: 'legendMargin', config: { type: 'TextControl', label: t('Margin'), renderTrigger: true, isInt: true, default: legendMargin, description: t('Additional padding for legend.'), visibility: ({ controls }: ControlPanelsContainerProps) => Boolean(controls?.show_legend?.value), }, };
Checklist
- [ ] I have searched Superset docs and Slack and didn't find a solution to my problem.
- [x] I have searched the GitHub issue tracker and didn't find a similar bug report.
- [ ] I have checked Superset's logs for errors and if I found a relevant Python stacktrace, I included it here as text in the "additional context" section.
Comment From: dosubot[bot]
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.
How did I do? Good | Irrelevant | Incorrect | Verbose | Hallucination | Report 🐛 | Other
Comment From: msyavuz
Hey, @saha23412 Does the mentioned pr #34911 fix this? You can test that on master branch.
Comment From: SBIN2010
Hey, @saha23412 Does the mentioned pr #34911 fix this? You can test that on master branch.
Hi @msyavuz pr #34911 just adds legend sorting Margin legends is indeed missing from MixedTimeseries chart