How to create stacked bar chart

elogancrawford
elogancrawford New Altair Community Member
edited November 5 in Community Q&A
In RM v9.0, we created a stacked bar showing number of observations per region based on 3 different amounts as follows: Group-by 'region', Stacked col 'amount', Legend col 'amount', Value col 'amount', Aggregation 'count'. How do we create this same chart in v9.2? 

Answers

  • Marco_Barradas
    Marco_Barradas
    Altair Employee
    Pivot your data.
  • IngoRM
    IngoRM New Altair Community Member
    I was running into a similar problem today...  While Pivoting first seems to do the trick indeed, I was also expecting that this should be possible with the new charts alone as well.  However, I was not able to pull it off myself so I am going to tag @Marco_Boeck here.  I am sure he can help you with this (or confirm in case this is a bug...)
    Thanks,
    Ingo

  • Marco_Boeck
    Marco_Boeck New Altair Community Member
    edited March 2019
    Hi,

    Currently not supported. Aggregating on number columns is disabled because it's very easy to absolutely murder your computer by selecting a column with too many distinct values (as evident when trying to use the old Stacked Bars on a trivially small data set like Titanic and freezing Studio for a good minute when selecting the wrong columns. Imagine doing that on a bigger data set).

    Regards,
    Marco
  • sgenzer
    sgenzer
    Altair Employee
    ok not a bug but can be a feature request. Let me know if you want me to push it, @IngoRM.

    Scott

  • IngoRM
    IngoRM New Altair Community Member
    I am not sure if I understand.  When you refer to the "aggregation for numerical column" do you refer to the grouping?  I think the problem is more that for stacked bar chart you may have two grouping columns (one for the groups of bars as usual, the second one for the stacks).  See the screenshot below.  Here two categorical columns are used for the groups and the stacks and the numerical column is averaged... Or did I misunderstand this?
    Anyway, this can be achieved by Pivoting first.  Excel is doing the same BTW.  Personally I do not need a feature request for, although I must admit that this was indeed a bit comfortable to achieve with the old charts.  But other than that I actually like the new charts quite a lot BTW!
    Cheers,
    Ingo

  • Marco_Boeck
    Marco_Boeck New Altair Community Member
    Hi Ingo,

    Yep, I know you'd need two grouping columns here. We don't offer that (yet) for bar/line charts, but allowing that is certainly possible in the future. But even then, the numerical grouping problem remains, which ultimately will prohibit this in the new charts I think. That's why I mentioned it ;)

    Regards,
    Marco
  • sgenzer
    sgenzer
    Altair Employee

    Personally I do not need a feature request...

    LOL yeah I guess you don't @IngoRM :wink:

  • IngoRM
    IngoRM New Altair Community Member
    edited April 2019
    This is AWESOME!  Thanks @Marco_Boeck
    And BTW: I like the idea with the white bar on the left side indicating which parameters belong to the aggregation :)
  • harsha6055
    harsha6055 New Altair Community Member
    How to obtain mosaic graph is it possible?