apache / superset

Apache Superset is a Data Visualization and Data Exploration Platform
https://superset.apache.org/
Apache License 2.0
63.18k stars 14k forks source link

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

Open WibowoS26 opened 1 year ago

WibowoS26 commented 1 year ago

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):

Checklist

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

Additional context

Add any other context about the problem here.

sfirke commented 1 year ago

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 commented 1 year ago

@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

mtrentz commented 1 year ago

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 commented 1 year ago

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

704998200 commented 10 months ago

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

704998200 commented 10 months ago

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 commented 8 months ago

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 commented 7 months ago

@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 commented 7 months ago

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

felipegranado commented 4 months ago

Hi..

This issue persits on 4.0.1.

sfirke commented 4 months ago

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 commented 4 months ago

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 commented 4 months ago

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 commented 4 months ago

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 commented 4 months ago

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 commented 1 month ago

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