Bug description

To reproduce the problem: 1) Create a chart MixedTimeseries 2) Add Dimensions to query A or B 3) Legend for this query is not displayed

The same behavior when the 'Show query identifiers' checkbox is checked

Screenshots/recordings

before adding dimensions Image

after adding dimensions Image

Image

Show query identifiers checked: Image

Superset version

master / latest-dev

Python version

3.9

Node version

16

Browser

Chrome

Additional context

No response

Checklist

  • [ ] I have searched Superset docs and Slack and didn't find a solution to my problem.
  • [ ] 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]

This looks like a real issue with how the MixedTimeseries chart handles legend rendering when dimensions are added. Recent changes to the chart's logic (see PR #34406) updated how legend series names are constructed: when dimensions (groupby) are present, the legend should display entries like "metric, dimension" (optionally with query identifiers if enabled). The legend data is built from the transformed series, filtered to exclude forecast series, and mapped to their names, so if the dimensioned series are not being included or named as expected, the legend may disappear or appear empty.

There are no existing tickets or docs that directly address this bug. The relevant logic is in superset-frontend/plugins/plugin-chart-echarts/src/MixedTimeseries/transformProps.ts, where legend entries are generated based on the presence of dimensions and the showQueryIdentifiers setting. Recent refactors (see PR #34709) may also have affected how series and legend labels are processed.

If you haven't already, try toggling the "Show query identifiers" option in the chart controls to see if it affects legend visibility. If the issue persists, it's likely a bug in how the legend data is constructed when dimensions are present. You may want to review or debug the logic in transformProps.ts around how series names and legend data are built when groupby/groupbyB is set.

References:
- Legend naming and query identifier logic
- Recent refactor affecting legend/series processing
- Legend construction in transformProps.ts

To reply, just mention @dosu.


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

Comment From: rusackas

So it seems the legend doesn't display only when "Show Query Identifiers" is checked? CC @mistercrunch since he added that... maybe we can add some tests here with a fix PR.

Comment From: mistercrunch

I don't think that was me ... if so I forgot!

Comment From: rusackas

Resolved by the merged PR. Thanks for both things! :D