3 Replies Latest reply on Mar 24, 2016 2:54 PM by Joshua Cloud

    Rankings, Colors, and Pretty Graphs

    Josh Mahar

      Hi There,


      Inspired by the "History of the NFL" viz by Matt Chambers, I'm trying to do something similar, although admittedly quite a bit more boring than that.


      I'm trying to show each county in Washington state with a stacked area graph that indicates the different percentages of population that each city makes up in that county. I currently have it done over time, but that isn't really necessary since things don't change much.  Here's an example of one for Clallam County:



      Now, I'm running into a few problems here that I'm looking for some help on.


      1.) The colors are currently based on percentage ranking. I like that, but I'd like to pull out the "Unincorporated" and have it always ranked as 0 or something else, so that I can set it as a different color from the rest.

      2.) I'd also like Unincorporated to show up always on the bottom.

      3.) The color spectrum works well when there aren't many jurisdictions, but some counties have like 40 jurisdictions. I'd kind of rather have the colors work for the first 6 or 7 jurisdictions, but then just be white for all the smaller ones. Is that possible?


      I've attached the workbook here. Any help would be greatly appreciated. Thanks!

        • 1. Re: Rankings, Colors, and Pretty Graphs
          Joshua Cloud



          See below for an explanation for the attached 9.2 twbx.

          1) Try this formula for Rank instead:

          2) You have a manual sort on the Jurisdiction, just find Unincorporated and move it to the bottom.


          3) Having 3 color scales working together isn't possible with continuous values, however if we convert them to discreet we can do something similar.

          I created 2 more fields, Rank2:

          and Color unincorporated:


          I changed Rank, Rank2 and Color unincorporated to discreet:

          Then I added Color unincorporated to the color mark, and added Rank2 to the detail mark.

          From here you can change the mark type to color and compute using Jurisdiction.

          You can then edit the colors palette from the default, I selected the Red palette and clicked "Assign Palette".

          Here you can also change the individual colors on the left by clicking them and selecting a different color from another palette.


          I hope this helps.



          1 of 1 people found this helpful
          • 2. Re: Rankings, Colors, and Pretty Graphs
            Josh Mahar

            This is amazing help, thanks so much Josh!


            One last item, is there any way to sort each stacked bar chart by the rank? Since Unincorporated is listed as "0" anyway, it seems it would end up at the bottom.

            • 3. Re: Rankings, Colors, and Pretty Graphs
              Joshua Cloud

              Hmm, the closest that I got to was sorting Jurisdiction by Field: Population as an aggregated sum

              Click Apply, then change the Sort by to Manual, and move Unincorporated back to the bottom.


              Otherwise it wouldn't let me sort by rank.