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

Bar chart does not emit cross-filter if dimension is not set #25334

Open
3 tasks
WibowoS26 opened this issue Sep 19, 2023 · 17 comments
Open
3 tasks

Bar chart does not emit cross-filter if dimension is not set #25334

WibowoS26 opened this issue Sep 19, 2023 · 17 comments
Labels
validation:validated A committer has validated / submitted the issue or it was reported by multiple users

Comments

@WibowoS26
Copy link

A clear and concise description of what the bug is.

How to reproduce the bug

on superset 3.0.0

dashboard below before using cross filters

1

dashboard below after using cross filters on blue bar chart

2

same dashboard but using cross filters on the pie chart

4

same dashboard but using dimensions on bar chart

7

Expected results

cross filters work with bar chart without the need of dimensions

Actual results

cross filters on bar chart only work when using dimensions

Screenshots

If applicable, add screenshots to help explain your problem.

Environment

(please complete the following information):

  • browser type and version:
  • superset version: superset version
  • python version: python --version
  • node.js version: node -v
  • any feature flags active:

Checklist

Make sure to follow these steps before submitting your issue - thank you!

  • I have checked the superset logs for python stacktraces and included it here as text if there are any.
  • I have reproduced the issue with at least the latest released version of superset.
  • I have checked the issue tracker for the same issue and I haven't found one similar.

Additional context

Add any other context about the problem here.

@sfirke
Copy link
Member

sfirke commented Sep 22, 2023

Interesting, people have reported cross filters not working for bar chart but I hadn't seen anyone point out it was dimension-specific. Thanks for the bug report.

@WibowoS26
Copy link
Author

@sfirke yes, because you can't reuse same column for metrics and dimensions on bar chart you need to add another column to be used in dimensions

@sfirke sfirke changed the title Cross filters on bar chart only work when using dimensions Bar chart does not emit cross-filter if dimension is not set Nov 3, 2023
@mtrentz
Copy link

mtrentz commented Nov 16, 2023

Running into the same problem (3.0) and also noticed it's dimension specific.

It seems that it tries to filter by the metric of the bar chart. When I click in one of the bars and hover over the filter applied in other charts it shows like this:

image

In contrast, doing it instead with a pie chart it shows on hover that is being filter by the correct dimension (name of salesperson in this case)

Screenshot 2023-11-16 at 08 51 28

@sfirke
Copy link
Member

sfirke commented Nov 17, 2023

Someone gave a good description of the bug in Slack, with videos. https://apache-superset.slack.com/archives/C0170U650CQ/p1698853673073119?thread_ts=1684878085.826729&cid=C0170U650CQ

@sfirke sfirke added the validation:validated A committer has validated / submitted the issue or it was reported by multiple users label Nov 17, 2023
@704998200
Copy link

I have also seen this issue.Is there any update?Or any solution?

@704998200
Copy link

704998200 commented Jan 12, 2024

If category axis is not a date,you can set like this.It works for me.

(https://github.com/apache/superset/assets/49085215/7f1cd5c8-2267-45fe-92f3-927ac9898486)
(https://github.com/apache/superset/assets/49085215/b404037f-c14f-46e4-a2e5-83343be0c4b5)

@sfirke
Copy link
Member

sfirke commented Apr 2, 2024

I think the ideal fix would be: bar charts without dimension emit cross-filters as if the series was a dimension. That seems to be the behavior people expect. I have no idea how hard that is to implement.

@visharavana
Copy link
Contributor

visharavana commented May 8, 2024

@sfirke @WibowoS26 I've noticed this problem with 4.0 as well. Has anything changed recently? or a possible fix?
I want only one color, however if I use dimensions, the bar color will show every bar as every color.

@sfirke
Copy link
Member

sfirke commented May 8, 2024

@visharavana this issue persists through 4.0.0. I do not know of a fix or workaround at this time.

@felipegranado
Copy link

Hi..

This issue persits on 4.0.1.

@sfirke
Copy link
Member

sfirke commented Jul 18, 2024

Correct, it persists on the latest version 4.0.2 as well. I expect that if/when this is addressed, the pull request will link back here and close the issue.

@felipegranado
Copy link

felipegranado commented Jul 19, 2024

Hi!

I didn't understand the X-Axis in this graph, this field is mandatory and at the same time it has no Cross-Filter action...

The funniest thing is that the legacy chart does not have this X-Axis and only the Dimensions field (and it is not mandatory).

Even because the X-Axis can become Y-Axis just by changing the format of the graph... so I didn't quite understand the meaning of this field. Dimensions field has everything we need.

I believe that making Dimensions mandatory instead of X-Axis will solve everything!

Thank you in advance for your efforts in resolving the issue. I'm just getting to know the tool now and it's very promising!

PS: And the same thing happens in the line graph!

@smrodin
Copy link

smrodin commented Jul 22, 2024

If category axis is not a date,you can set like this.It works for me.

(https://github.com/apache/superset/assets/49085215/7f1cd5c8-2267-45fe-92f3-927ac9898486) (https://github.com/apache/superset/assets/49085215/b404037f-c14f-46e4-a2e5-83343be0c4b5)

Thanks, but when doing this, char bars get too narrow

@felipegranado
Copy link

If category axis is not a date,you can set like this.It works for me.
(https://github.com/apache/superset/assets/49085215/7f1cd5c8-2267-45fe-92f3-927ac9898486) (https://github.com/apache/superset/assets/49085215/b404037f-c14f-46e4-a2e5-83343be0c4b5)

Thanks, but when doing this, char bars get too narrow

Oh.. I forget...

In CUSTOMIZE, you need choose "STACK" option...

@smrodin
Copy link

smrodin commented Jul 23, 2024

If category axis is not a date,you can set like this.It works for me.
(https://github.com/apache/superset/assets/49085215/7f1cd5c8-2267-45fe-92f3-927ac9898486) (https://github.com/apache/superset/assets/49085215/b404037f-c14f-46e4-a2e5-83343be0c4b5)

Thanks, but when doing this, char bars get too narrow

Oh.. I forget...

In CUSTOMIZE, you need choose "STACK" option...

It works like a champ, thanks for your support

@heiwanokami
Copy link

I would like this to work so that the cross filter field is the category on x axis not the value (i have categrized data by warehouse zone stock and when i click the zone i expect to filter the neighbour table to be crossfiltered only to the item stored in that zone... curently the cross filter sends the number of pallets in the zone not the zone category... I think this may be common problem with the one reported

@jiangzihan
Copy link

Haha....

This issue persits on 4.1.1 too...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
validation:validated A committer has validated / submitted the issue or it was reported by multiple users
Projects
None yet
Development

No branches or pull requests

9 participants