Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Charts duplicating in tabs #28313

Closed
2 of 3 tasks
robson-koji opened this issue May 2, 2024 · 5 comments
Closed
2 of 3 tasks

Charts duplicating in tabs #28313

robson-koji opened this issue May 2, 2024 · 5 comments

Comments

@robson-koji
Copy link

Bug description

Hi, I think there is a bug. I am using the most recent version, 4.0.0. I am using tabs in the dashboard, and for some unknown reason, some charts that I added to one tab also display in all other tabs. If I delete this chart from one tab, it also deletes from all the other tabs. If I add another tab, these charts will be added automatically if they are present in the other tabs.

I started to debug and I think I've found how this happens, but not why. Looking at the database table 'dashboards', column 'position_json', all working charts have five parents, but the wrong charts don't have the parent tabs.

    "CHART-psM0LLtTBc": {
        "children": [],
        "id": "CHART-psM0LLtTBc",
        "meta": {
            "chartId": 142,
            "height": 50,
            "sliceName": "Sales",
            "uuid": "1e79c3f4-e388-42d8-aa8f-0c41f24351d5",
            "width": 12
        },
        "parents": [
            "ROOT_ID",
            "GRID_ID",
            "TABS-RVg9XImKja",
            "TAB-_5SRUXFBC",
            "ROW-L3m0WfT_l_"
        ],
        "type": "CHART"
    },
    "CHART-uWtgnzN_0_": {
        "children": [],
        "id": "CHART-uWtgnzN_0_",
        "meta": {
            "chartId": 141,
            "height": 64,
            "sliceName": "Shipping",
            "uuid": "d1a48172-4305-47bd-81cc-1a74b398896c",
            "width": 12
        },
        "parents": [
            "ROOT_ID",
            "GRID_ID",
            "ROW-ktUUc_Sn-y"
        ],
        "type": "CHART"
    },

How to reproduce the bug

I don't know how to reproduce yet but I can come later.

Screenshots/recordings

No response

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.
@robson-koji
Copy link
Author

robson-koji commented May 2, 2024

Update 1 - This is not a problem with any specific chart. Since the behavior starts, any other added chart happens the same. Even with charts that were working correctly, if removed and added again, they will appear in all tabs.

Update 2 - I recreated the dashboard with the same charts and the problem has gone. To build the dashboard I had to make a lot of changes in the charts, datasets, queries, tabs, naming and other configurations. Maybe something brake then.

I still have the non working dashboard and I tried to debug in the browser, but I didn't find any clue in the request/response. If you need more information, please just let me know.

@rusackas
Copy link
Member

rusackas commented May 2, 2024

If you see any errors in your logs or browser console, or know any reproduction steps to recreate your problematic dashboard, that might be really helpful. If we can't reproduce it, this issue might go stale and get closed at some point.

@sfirke
Copy link
Contributor

sfirke commented May 3, 2024

Could it be the case that you think you are adding a chart to a tab, but you're silently adding it under the tab where it is global? Try dragging the chart up to be the top chart on a tab -- above a different chart that correctly appears on only one tab.

I've had this problem, and even now that I'm aware of it, sometimes the only way I know to make the chart (or widget, or whatever) appear on only one tab is to drag it up to be above another chart that is on the tab, then drag that chart above my new chart. Then I get the ordering of charts I want and both are on the tab.

@fisjac
Copy link
Contributor

fisjac commented May 15, 2024

As @sfirke mentioned it's possible to have a structure where a chart isn't nested underneath any particular tab. Such a structure might look like this under the hood:
ROOT
└── GRID
    ├── TABS
    │   ├── TAB1
    │   └── TAB2
    └── ROW
    └── CHART
In this scenario, regardless of which tab is selected, you'd still see the output of the chart beneath the tabs since it's not nested inside the tabs.

Was this the case in your scenario?

@robson-koji
Copy link
Author

@sfirke - You are absolutely right. It was added globally.
When I was researching for the problem I saw people saying that it was not possible to add charts globally, so I didn't consider this option. I am sorry for the late reply, I've been very busy.
Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants