4 Replies Latest reply on Aug 27, 2010 11:32 PM by Richard Leeke

    Stacked Area Graphs

    Jordan Cardonick

      It would be nice to be able to create stacked area graphs similar to what is possible in excel. Currently, the best I can do is to take a stacked bar and run it across continuous dates and it looks extremely block-y and dull. It seems to be a fairly popular secondary chart type and would help our company significantly to be able to do this in Tableau instead of excel.

        • 1. Re: Stacked Area Graphs
          guest contributor

          I agree, this would be a really useful feature, particularly for charts where you want to show a running sum.  You can do it with lines, but they don't stack, and when you switch to a bar chart the running sum feature does not show.

          • 2. Re: Stacked Area Graphs
            . Tableautester

            Are looking for something like this: http://officeimg.vo.msecnd.net/en-us/files/384/002/ZA010090286.gif ?


            What do you think of the attached stacked bar chart?


            These are the steps:


            1. Choose Marks: Bar

            2. Select Analysis > Stack Marks > On

            • 3. Re: Stacked Area Graphs
              Jordan Cardonick

              Tableautester . . .


              Yeah the top picture is exactly what we would be looking for.


              What you posted is similiar to what I did, but with spaces in between the bars, which goes back to the very block-y look.


              You need to do it with lines that stack and fill below. If I'm going to take the time to format the bar chart and it look bad, I might as well just do it in Excel.

              • 4. Re: Stacked Area Graphs
                Richard Leeke

                You can do this with a bit of crafty use of polygon mark types and calculated fields, as long as you manipulate your data series to generate a closed polygon for each series.  You can either do that by inserting dummy rows in the source data or with a bit of custom SQL.


                Take a look at the attached - which is something I played with a while ago.  I can't remember exactly what I did - I think it's just a matter of dummy marks at each end of the series to draw the polygon boundary down to zero, and then defining an appropriate table calculation and picking a mark type of polygon.  Sing out if anyone is interested but can't figure it out from the example.


                The workbook just uses the coffee sales example data - you might have to repoint the data source if you have Tableau installed in a non-default location.


                For the sorts of things for which I believe this is an appropriate representation it's often strictly better to represent the data as a stacked "stepped area" chart (that's what I call them - I don't know if that's a recognised term - I just mean horizontal lines between x-axis points - often time - where there is a sudden delta in the y-axis value).  You can do that with polygons, too, though it again needs a bit of logical or physical data manipulation (i.e. edit the source or use custom SQL to insert extra values to generate the steps).


                There's an example of how to do the steps (though in this case not as a stacked area chart) in the example I posted in this  thread.



                I agree that Tableau could definitely do with direct support for stacked area representations as a "first class citizen", one day.  It's quite kludgy to do it the way I've described, and what you end up with hasn't got all the normal nice Tableau features (no tooltips, no highlighting, etc).  I haven't ever seen it said explicitly, but I suspect that they are not there because of concerns that it is very easy to produce misleading visualisations with stacked area charts.  Whether or not that's the reason (and I certainly think it's true that they can be misleading), there are also times when I think it's the preferred approach (hence going to the trouble of figuring out what I could do with polygons).