Bug description

Excessive legend values in charts cause overlaps with the chart itself. This issue affects all ECharts, regardless of the Superset version. With old line charts being removed in version 5.0.0, we have no alternative. We’d appreciate your help in resolving this. Thank you.

Old line chart

Image

This is how it looks with new echarts.

Image

Screenshots/recordings

No response

Superset version

master / latest-dev

Python version

3.9

Node version

16

Browser

Chrome

Additional context

No response

Checklist

  • [x] 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.
  • [x] 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]

There isn't a built-in Superset UI control to prevent legend overlap in ECharts when there are many legend entries. However, the ECharts plugin in Superset does support advanced legend configuration, including scrolling, via the chart options. The relevant code shows that legend properties like legendType, legendOrientation, and scrollDataIndex are passed to ECharts, and the helper getLegendProps manages legend display and scrolling logic. This means you can potentially enable legend scrolling (which prevents overlap) by setting legend.type: 'scroll' in the chart's custom JSON configuration if your chart type and Superset deployment expose this option. See the legend configuration logic here.

Recent pull requests have improved legend pagination and usability for long legends, but they do not directly solve the overlap when the legend is too large for the chart area—scrolling or truncation must be enabled via configuration if available in your chart controls PR #33779 PR #33728.

If your chart's control panel does not expose legend scrolling, you may need to use the "Customize" or "Advanced" section to inject custom ECharts JSON, or request this as a feature for your deployment. There are no existing tickets or documentation that directly address this issue.

To reply, just mention @dosu.


How did I do? Good | Irrelevant | Incorrect | Verbose | Hallucination | Report 🐛 | Other  Join Discord Share on X

Comment From: rusackas

Similar to the bot, I was going to suggest enabling scrolling (and perhaps pagination, if relevant) on legends. Open to other suggestions. I feel like just squeezing the chart down isn't a great alternative, is a giant set of legends could reduce the chart to uselessness.

CC @kasiazjc for input.

Comment From: iercan

We just want it to work the same way old charts work. We don't want to turn it into scrolling.