Filtering and Formatting
We have a simple chart showing how many times each tag in our dataset is used. With a little work we can turn this into a very nice bar chart showing only the top tags.
- Sort a bar chart.
- Apply a "top" filter to a worksheet.
- Add formatting to a bar chart.
Since we want to see the top tags, it makes sense to sort our bar chart to show the most common tags at the top. In fact, as a general rule it makes sense to sort bar charts in increasing or decreasing order. The main exception would be if the categories (in this case tags, but they could be anything) have a natural order that would be unwise to break up. As our list of tags has no such order, we want to sort it.
- Hover over the "Tag" label (above the bar chart) and click on the arrow that appears. Since "Tag" is such a short word, almost the whole label will be covered by the dropdown arrow.
- Choose Field -> CNT(tags.csv) to sort based on the number of mods using each tag.
While we can see which tags are the most popular, the bar chart is still displaying all of the tags, and there are quite a lot. We can simplify this by having Tableau filter out everything except the top twenty we want to see.
- Locate Tag from tags.csv on the Data sidebar, and drag it onto the Filters shelf.
- In the popup menu, go to the Top tab on the far right.
- Choose the option for By field.
- The default should be Top 10 by tags.csv Count. This is almost exactly what we want. Change the 10 to 20.
- Click OK.
The filtered chart:
Finally, we want to add some formatting to make our chart prettier and more useable. The types of formatting we can do with a bar chart (and many other similar types of charts) are very different from what we can do with a map. For this chart we will focus on removing distracting or extraneous information.
Edward Tufte, a famous figure in data visualization, coined the term "chartjunk" in his book The Visual Display of Quantitative Information. In essence, chartjunk is unnecessary ink that distracts a viewer from the information presented in a visualization. We have quite a bit of chartjunk we can remove from this visualization. We can remove an extraneous label, the unnecessary grid lines, and the bottom axis.
If you would like more information about how to design visualizations, I strongly recommend reading The Visual Display of Quantitative Information by Edward Tufte. It is currently on reserve at Bizzell Memorial Library, which means you can ask for it at the front desk and check it out for four hours at a time. Tufte, E. (1983). The Visual Display of Quantitative Information. Graphics Press.
There is also a copy of Tufte's book available online from the Open Library.
- At the top of the bar chart, note the word "Tag" above the row labels (this is the label we hovered over to sort the chart). We can remove this extraneous label.
- Right click on "Tag" and choose Hide Field Labels for Rows.
If you ever want to show a field label you have hidden, you can go to top menubar and choose Analysis -> Table Layout -> Show Field Labels for Rows.
- Next we will remove extra grid lines. Right click on a blank area of the worksheet and choose Format....
- On the formatting tab that appears on the left there is a list of five symbols. Click on the lines symbol.
- Change Grid Lines to None. The dropdown already says None, but this is incorrect because manually changing it removes lines. Note that the dropdown provides additional options for line style, width, and color.
- For good measure, set Zero Lines, Axis Rulers, and Axis Ticks to None as well.
- Unfortunately, this change is deceptive. Under Format Lines, choose Columns instead of Sheet. The Grid Lines dropdown here is not set to None!
- Change Grid Lines to None here as well.
When I first made and saved a bar chart, I was very surprised to see that the saved visualization still showed grid lines despite having set the Sheet lines to None. It took a bit of experimentation and exploration until I found the problem with the Column lines.
- Right click anywhere on the bottom axis and click Show Header to uncheck it.