Bug description

Description:

When switching between different chart types in Superset, duplicate measures are added unexpectedly. This issue occurs specifically when switching between a Line Chart and a Waterfall Chart.

Steps to reproduce:

  1. Create a Line Chart and set up the X-Axis and a Measure (e.g., SUM(goods_services_export)).
    Image

  2. Change the chart type to Waterfall Chart. The selected measure is sometimes removed.
    Image

  3. Re-add the same measure (SUM(goods_services_export)) and build the chart successfully.
    Image

  4. Switch the chart type back to Line Chart. Now, the measure appears twice in the settings. Image

  5. If you continue switching between chart types (Line Chart → Waterfall Chart → Line Chart), new duplicate measures keep appearing. Image

Expected behavior:

Switching between chart types should not result in duplicate measures. The selected measures should persist without being reset or duplicated.

Actual behavior:

  • Measures are removed when switching to a Waterfall Chart.
  • When switching back to a Line Chart, the measure is duplicated.
  • Repeating the switch process keeps adding more duplicates.

Environment:

  • Database backend: ClickHouse

Possible Cause:

It seems like the UI is not correctly handling measure persistence when switching chart types. Measures might not be properly reset or are being re-added instead of being retained.

Additional context:

This issue happens inconsistently, but once it starts, it continues with every switch between chart types.

Screenshots/recordings

No response

Superset version

4.1.1

Python version

I don't know

Node version

I don't know

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

The issue you're experiencing with duplicate measures appearing when switching between chart types in Superset seems to be related to how the frontend handles measure persistence. Unfortunately, I couldn't find specific information in the repository about how Superset manages state for chart configurations or any known issues related to this behavior in version 4.1.1.

However, Superset's frontend differentiates between chart types using plugins configured with unique keys for each visualization type. Each plugin is responsible for the specific configuration and rendering logic of its associated chart type [1]. This might be where the issue arises, as the state management for measures might not be correctly handled when switching between incompatible chart types like Line Chart and Waterfall Chart.

To address this issue, you might want to investigate the frontend code responsible for managing chart configurations and see if there are any discrepancies in how measures are reset or duplicated when switching chart types. Additionally, checking for any recent updates or patches in the Superset repository that might address this issue could be helpful.

To continue talking to Dosu, mention @dosu.


Help Dosu learn! Give it feedback: Great Response | Irrelevant Answer | Incorrect Sources | Too Verbose | Hallucination | Bug Report | Other