{"action":"created","issue":{"url":"https://api.github.com/repos/metabase/metabase/issues/1449","repository_url":"https://api.github.com/repos/metabase/metabase","labels_url":"https://api.github.com/repos/metabase/metabase/issues/1449/labels{/name}","comments_url":"https://api.github.com/repos/metabase/metabase/issues/1449/comments","events_url":"https://api.github.com/repos/metabase/metabase/issues/1449/events","html_url":"https://github.com/metabase/metabase/issues/1449","id":115174857,"number":1449,"title":"Confused about how stacked bar charts are supposed to work","user":{"login":"sherbondy","id":193187,"avatar_url":"https://avatars.githubusercontent.com/u/193187?v=3","gravatar_id":"","url":"https://api.github.com/users/sherbondy","html_url":"https://github.com/sherbondy","followers_url":"https://api.github.com/users/sherbondy/followers","following_url":"https://api.github.com/users/sherbondy/following{/other_user}","gists_url":"https://api.github.com/users/sherbondy/gists{/gist_id}","starred_url":"https://api.github.com/users/sherbondy/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sherbondy/subscriptions","organizations_url":"https://api.github.com/users/sherbondy/orgs","repos_url":"https://api.github.com/users/sherbondy/repos","events_url":"https://api.github.com/users/sherbondy/events{/privacy}","received_events_url":"https://api.github.com/users/sherbondy/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/metabase/metabase/labels/Bug","name":"Bug","color":"CC333F"},{"url":"https://api.github.com/repos/metabase/metabase/labels/Visualization","name":"Visualization","color":"95EBFC"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":6,"created_at":"2015-11-04T23:36:22Z","updated_at":"2016-02-10T20:15:06Z","closed_at":null,"body":"Hey all,\r\n\r\nSo I read on the discourse that stacked bar charts are supposedly implemented:\r\nhttp://discourse.metabase.com/t/advanced-charting-features/57/2\r\n\r\nTried to get one to appear.\r\nFigured it'd involve doing an aggregate by two different columns so I did a:\r\n\"count by connected_table_a.field1 and connected_table_b.field2\"\r\n\r\nWhat was weird was depending on the \"type\" of table_b.field2, I got wildly different results, even though the tabular representation remained more-or-less the same.\r\n\r\nFields of the second table that I tried (one with **Entity Key** meta, two with **Category** meta):\r\n<img width=\"299\" alt=\"screen shot 2015-11-04 at 6 18 48 pm\" src=\"https://cloud.githubusercontent.com/assets/193187/10955347/250869d8-8321-11e5-81bd-7342cd4e500a.png\">\r\n\r\n##Attempt 1 Table (looks good):\r\n<img width=\"842\" alt=\"screen shot 2015-11-04 at 6 17 01 pm\" src=\"https://cloud.githubusercontent.com/assets/193187/10955331/15d5364e-8321-11e5-9469-390ad849fb52.png\">\r\n##Corresponding Bar Chart:\r\n<img width=\"840\" alt=\"screen shot 2015-11-04 at 6 18 38 pm\" src=\"https://cloud.githubusercontent.com/assets/193187/10955392/6137e41a-8321-11e5-820a-51ce474a2e98.png\">\r\nCompletely blank.\r\nExpected Bar Chart: Stacked bar chart with count summed across rows, with each stack corresponding to a distinct slug.\r\n\r\n#Attempt2:\r\nThought I'd try grouping by the ID field instead. Results below:\r\n\r\n##Attempt 2 Table (looks good):\r\n<img width=\"853\" alt=\"screen shot 2015-11-04 at 6 26 51 pm\" src=\"https://cloud.githubusercontent.com/assets/193187/10955433/b68f6f82-8321-11e5-91e2-b6dcbb9cb0f9.png\">\r\n##Corresponding Bar Chart:\r\n<img width=\"856\" alt=\"screen shot 2015-11-04 at 6 18 10 pm\" src=\"https://cloud.githubusercontent.com/assets/193187/10955464/f3b5d0a4-8321-11e5-972f-c02c6557fe2f.png\">\r\nGot values, but they are not stacked :(\r\n\r\n#Attempt 3:\r\nTried using the name field for both. Figured this would completely fail because of #1447 \r\nGot something quite surprising.\r\n\r\n##Attempt 3 Table:\r\nGuess it decided to split into field_a's category count instead of field_b's category count because of name conflict. Somehow \"count\" ended up as the title for the first column in the results table.\r\n<img width=\"1036\" alt=\"screen shot 2015-11-04 at 6 32 22 pm\" src=\"https://cloud.githubusercontent.com/assets/193187/10955546/8b869f58-8322-11e5-829d-092b65e0ad5b.png\">\r\n##Corresponding Bar Chart:\r\n<img width=\"1271\" alt=\"screen shot 2015-11-04 at 6 34 19 pm\" src=\"https://cloud.githubusercontent.com/assets/193187/10955563/bc45185e-8322-11e5-9173-aa1f99a5e2d1.png\">\r\n\r\nWoohoo! A stacked bar chart. So the unicorn does exist. Except:\r\n1. There are only 2 chunks stacked even though there are 3 distinct fields.\r\n2. The values for the stacks are garbage. In fact, both stacks are the exact same height and are actually just the total for the order count repeated twice."},"comment":{"url":"https://api.github.com/repos/metabase/metabase/issues/comments/182561162","html_url":"https://github.com/metabase/metabase/issues/1449#issuecomment-182561162","issue_url":"https://api.github.com/repos/metabase/metabase/issues/1449","id":182561162,"user":{"login":"camsaul","id":1455846,"avatar_url":"https://avatars.githubusercontent.com/u/1455846?v=3","gravatar_id":"","url":"https://api.github.com/users/camsaul","html_url":"https://github.com/camsaul","followers_url":"https://api.github.com/users/camsaul/followers","following_url":"https://api.github.com/users/camsaul/following{/other_user}","gists_url":"https://api.github.com/users/camsaul/gists{/gist_id}","starred_url":"https://api.github.com/users/camsaul/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/camsaul/subscriptions","organizations_url":"https://api.github.com/users/camsaul/orgs","repos_url":"https://api.github.com/users/camsaul/repos","events_url":"https://api.github.com/users/camsaul/events{/privacy}","received_events_url":"https://api.github.com/users/camsaul/received_events","type":"User","site_admin":false},"created_at":"2016-02-10T20:15:06Z","updated_at":"2016-02-10T20:15:06Z","body":"Point of order: I think we should recategorize this as something other than \"Bug\", and perhaps change the title to something more actionable"}}