Tutorial: Visualizing Data Using Tableau, 2016 Edition

Tutorial: Visualizing Data Using Tableau, 2016 Edition

Today, I gave a workshop called “Visualizing Data with Tableau” as part of the Michigan State University Digital Humanities Workshop series for Fall 2016. The tutorial below covers everything we introduced in the workshop, including:

  1. Getting set up with Tableau Public and loading in data
  2. Creating a map
  3. Creating an area chart
  4. Creating a tree map
  5. Compiling a dashboard
  6. Publishing to the web

[Update: You can also build on this tutorial by adding a georectified map to Tableau. Learn how to georectify a map here, and learn how to put it into Tableau here.]

Before we get started, a few introductory things:

Why Tableau? There are MANY options out there for data visualization. What makes Tableau extremely useful is:

  1. There are many options for visualizing information, from maps, to bar charts, to bubbles and treemaps. Tableau lets you bring together a range of viz types in one place and to play and experiment among them with the same dataset. It’s a useful space for learning how to structure your data to tell the story or make the argument you want to convey.
  2. Interactivity – This is the easiest tool I have found for creating interactive visualizations that doesn’t require coding skills.
  3. Context – Not only can you show a visualization, but you can customize the display to include contextual information, such as data sources, images, sound, and additional text. The ability to provide context helps create a visual argument which is essential for a successful viz.
  4. Easy to publish online and to embed – If you want to share your visualization (and data, if you want), you don’t have to create a separate website to host it. You can simply send people to your Tableau profile. Alternatively, you can embed your Tableau visualization on your own website easily.

The data used for this tutorial comes from my personal research (see here for more) and comes from the Roman de la Rose Digital Library. It shows locations of surviving manuscript copies of one medieval book, the “Roman de la Rose” and includes information about the manuscripts, such as: the institution where the book currently is held; the approximate date of its creation; whether the manuscript has any illustrations, etc.

Be aware: It is important to note that Tableau is a commercial software, and as such operates on a freemium basis. A Tableau Public account is free to use, but it requires you to create a free account and to save your workbooks to publicly to its website. If you are concerned about privacy or are not connected to the internet (and therefore unable to save your work), take a screenshot of your visualization. Another option is to explore Tableau’s academic accounts. Applying for one of these accounts will allow you to download the full Desktop version, which has basically the same capabilities of Tableau Public BUT it allows you to save work locally to your computer. Academic licenses are available to teachers and students for classroom and research purposes. Find out more at tableau.com/academic. [The Tableau Desktop version usually costs a whopping $999/user.]

A final note: This workshop heavily built upon one Bobby Smiley and I ran in 2015 on the same topic. Find the tutorial for that workshop here.

Part 1 – Getting set up

  1. Download Tableau Public for free at public.tableau.com
    Note: This tutorial uses Tableau Desktop Public Version 10.0.1
  2. Create a free profile at public.tableau.com (this step is required to publish your data to the web and thereby to save it)
  3. Download the csv datafile found here
  4. Open Tableau and click “text file”
    tableau2016_tutorial1
    Note: Tableau 10 allows you to connect to Google Drive and to use a Google Sheet instead of a csv or excel file. For this tutorial, we are using a csv, but the benefit of using Sheets is Tableau will update as you add or change the content of your Sheet. To connect a Google Sheet to Tableau, either select “Google Sheets” or click “More” under the “To a Server” section, where you will see Google Sheets as an option.
  5. Open the csv file you just downloaded
  6. Tableau will look like this:
    tableau2016_tutorial2
    In the bottom half of the screen, we see the same information from the csv spreadsheet, and the top row shows column names as well as types of information. Note the icons below Latitude and Longitude. Below Longitude is a small globe, which indicates that Tableau recognizes the column’s information as geographic data. However, the icon below Latitude is a hash – this means that Tableau thinks this data is numeric, not geographic. Let’s fix Tableau’s error.
  7. Select the small hash icon below Latitude, and select “Latitude” in the “Geographic Role” section. Note that the icon then changes to the small globe, just like the Longitude column.
    tableau2016_tutorial3
    When working with your own data, you may have different types of geographic information – note that you have other ways to ID this info – area code, city, etc.
  8. Once the data types are all correct, click the orange “Go to worksheet” button in the center of the screen.
    tableau2016_tutorial4

    Part 2: Creating a Map

  9. You are given a blank workspace. On the left of the screen are each of the data columns/types. Those identified as strings (Abc) are listed under “Dimensions.” Other types of data (Numbers or Geo) are listed under “Measures.” For our purposes, “Date end” and “Date start” are listed as Numbers (#), but later we will treat them like strings. So, control click on them and drag them into “Dimensions.”
    tableau2016_tutorial5
  10. Let’s put this data on a map. Control/Command click on “Latitude” and “Longitude.” Once you have selected one or more data type from either Dimensions or Measures, the “Show Me” box in the top right of your workspace will highlight with a blue box any visualization types that work with the data types you have selected. For Latitude and Longitude, we see that the map visualization is highlighted in blue. Click on the map.
    tableau2016_tutorial6
  11. Now we can see a map, with a single point on it. Tableau has taken an average of all the Longitude and Latitude data (note the green boxes toward the top of the screen. Let’s fix this by telling Tableau to plot each point in the dataset. Select “Id” from “Dimensions” and drag and drop it onto the “Detail” box.
    tableau2016_tutorial7
  12. Now we can see a map with many points around the world. Let’s size the points based on how many manuscripts (items) are at each location (based on Lat/Long). Select “Id” from “Dimensions” again and drag and drop it onto the “Size” box.
    tableau2016_tutorial8
  13. Now we can get a sense of what places in the world have the highest density of these manuscripts. I have zoomed into show Europe for the moment because it has the most items in the dataset. Let’s add in some more information to the map. Let’s color the bubbles based on the number of manuscripts at each location that have at least one illustration. Select “Number of illustrations” from “Measures” and drag and drop it onto the “Color” box.
    tableau2016_tutorial9
  14. Now the bubbles show color gradation along a spectrum. See the “SUM(Number of illustrations)” box toward the lower right of the screen. If you click on the drop down arrow within that color spectrum box, you will see a list of options, select “Change Color”.
    tableau2016_tutorial10
  15. Change the color by clicking on the drop down “Palette” bar. You can change the display from showing color gradations on a continuous scale to showing points in 5 (or any number) of color buckets. To do so, check the “Stepped Color” box and adjust the number of steps you want to break down the color variation by. In the “Advanced” section, you may adjust the “Start”, “End”, and/or “Center” color values to correct for extreme outliers.
    tableau2016_tutorial11
  16. Select “Institution” from the “Dimensions” pane and drag and drop it onto the “Label” box. Now the map displays labels for each Lat/Long point on the map. In the center pane, click on the drop down arrow of the “Institution” box, and select “Show Filter.”
    tableau2016_tutorial12
  17. A panel with a list of all institutions on the map now displays next to the map. This is a way to filter the information to only see manuscripts on the map from one or several institutions.
    tableau2016_tutorial13
  18. At the bottom of the screen, double click on the “Sheet 1” tab and rename it.
    tableau2016_tutorial14

    Part 3: Creating an Area Chart

  19. Next to the tab you just renamed, click on the small graph tab. This will open a new workspace. Let’s create another visualization.
  20. Control/command click on the “Date start” field from “Dimensions” and “Number of Records” field from “Measures.” See how the “Show Me” box adjusts to select the best visualization for the data types selected. Click on the highlighted bar chart visualization.
    tableau2016_tutorial15
  21. Tableau puts the dates on the Y-axis (Rows) and Number of records in the X-axis (Columns). At the top of the screen, switch those two by dragging and dropping.
    tableau2016_tutorial16
  22. Let’s change the type of graph to an Area chart. In the “Marks” area, click on the drop down box and select “Area” instead of “Automatic.”
    tableau2016_tutorial17
  23. Now that you have an area chart, rename the sheet. Then, click on the tab next to it to create another workspace.
    tableau2016_tutorial18

    Part 4: Creating a Tree Map

  24. Select both “Number of Records” and “Institutions.” Note how in the “Show Me” menu, Tableau suggests most strongly that you choose the horizontal bar charts, like when we created the area chart. Instead, let’s select the Treemap visualization, which is also colored in to show that it will work with this type of data.
    tableau2016_tutorial19
  25. Add in the number of items for each box shown by dragging and dropping the “Number of records” into the “Label” box.
    tableau2016_tutorial20
  26. Now you have a Treemap with labels. You can change the color of the Treemap by clicking on the “color” box in the center panel and choosing a new color from the “edit color” box. Then, rename the worksheet and click on the tab in the bottom right of the screen. This will open a Dashboard for displaying your visualizations.
    tableau2016_tutorial21

    Part 5: Compiling a Dashboard

  27. You will have a blank screen, which looks similar to the worksheets. First, adjust the size of the working area by clicking on the dropdown box in the lower left to change “Size” from “Range” to “Automatic.”
    tableau2016_tutorial23
  28. Then, drag and drop each of your worksheets into the central work area.
    tableau2016_tutorial22
    Note how the filters and legend information for each visualization is now detached from its original visualization type and clustered on the right of the dashboard.
  29. When you click on any of the content boxes on the dashboard, note the gray bar at the top. Move the box around within the dashboard by clicking and dragging the top center of the box. Delete the box from the dashboard [this will not delete the information, just your ability to see it on this particular dashboard] by clicking on the X in the top right. Resize the boxes as you like by dragging any of the four sides.
    tableau2016_tutorial24
  30. Pair up any legend information you want to display on top of its relevant visualization. To move the “Number of illustrations” color gradation box onto the map, select the “Number of illustrations” box, click on the drop down arrow in the top right, and select “Floating.” Then drag the box over to the map area.
    tableau2016_tutorial26
  31. Notice how the tree map only fills up only part of it’s content box. Click on the drop down arrow in the top right, and select “Entire View” under “Fit.” Now the tree map takes up the entire space of its box.
    tableau2016_tutorial25
  32. To save space on the dashboard, eliminate the titles of each content box. Click on the drop down arrow in the top right of the box and uncheck “Show Title.”
    tableau2016_tutorial27
  33. The “Institutions” checklist on the right of the dashboard currently only filters information to the map. To have it filter information for all 3 of the visualizations, click on the drop down arrow in the top right of the box and select “All Using Related Data Sources” under “Apply to Worksheets.”
    tableau2016_tutorial28
  34. Uncheck the “Null” box in the “Institutions” list and note how the tree map in particular adjusts to now show only manuscripts that have a listed institution.
  35. Add a title to the Dashboard by dragging and dropping the “Text” button from the bottom left of the screen to wherever you want to put it on the dashboard. Format the text as you would in Word. Then resize the content box as you would any other.
    tableau2016_tutorial29
  36. Add a data source box at the bottom of the dashboard using the same method of dragging and dropping “Text” to where you want it. Then, change the name of the dashboard in the bottom tab from “Dashboard 1.”

    Part 6: Publish to the Web

  37. Select “Save to Tableau Public As” by clicking on File in the main menu.
    tableau2016_tutorial30
    Tableau will prompt you to sign in to your account.
    tableau2016_tutorial31
    Tableau will also prompt you to give a title to your visualization.
    tableau2016_tutorial32
  38. Tableau will open a tab in a browser and display your dashboard.
    tableau2016_tutorial33
    Scroll down, and edit the title, description, etc as you like. Uncheck the box “Allow workbook and its data to be downloaded by others” if you do not want to provide access to the data to the public. If you want to display not just your dashboard, but also each individual sheet, check the box “Show workbook sheets as tabs.” This function will display the same information as the dashboard but show each sheet on its own, which you may find useful.
    tableau2016_tutorial34
    If you choose to show each sheet as a tab, it will look like this:
    tableau2016_tutorial37
  39. Once you are done editing, click Save, and you can see your visualization. It is fully interactive, just like from within the Tableau interface. Share it via the URL you see. You may also share by embedding the visualization directly into your own website.
    tableau2016_tutorial35
  40. TIP: If you want to embed the visualization into your website, you can use the embed code provided, as you see above. HOWEVER, if you want to have the embedded viz be responsive to screen size (so that it resizes to work on a tablet, phone, etc), instead use this code:
    <iframe frameborder=”0″ height=”870″ scrolling=”no” src=”http://public.tableausoftware.com/views/romandelarose/Dashboard2?:embed=y&:display_count=y” width=”100%”></iframe>
    Instead of the URL you see in the code above, use the URL provided by Tableau (see step 9 above). The width of 100% will resize based on the width of the screen. You can adjust the height as you prefer for your site.
  41. REMEMBER that with a Tableau Public account, any visualization that you publish will be publicly accessible. The only way to save a worksheet and/or dashboard with a Public account is to publish to the web. One way to reduce the visibility of your visualization and thereby to increase privacy is to go to your profile, hover over the visualization, and click on the eye icon in the top right. This will make the visualization not display publicly on your profile. You can delete your visualization (which will delete it both from the Tableau Public website and will delete it entirely so you cannot use it in the future) by clicking on the trashcan in the bottom right corner. If you want to return to your visualization to edit it in Tableau, click on the download button in the bottom left corner.
    tableau2016_tutorial38
    You can also download your Tableau file to work on again from the online visualization itself by clicking on the “Download” button in the bottom right and selecting “Tableau Workbook.” This download option will not be available for others to select if you have unchecked the box to allow your data to be shared.
    tableau2016_tutorial36

2 Comments

  1. Pingback: Tableau Visualizations – Digital Humanities

  2. Pingback: Working with a Georectified Map (Part 1: Mapbox & Tableau) – Kristen Mapes

Leave a Reply

Your email address will not be published. Required fields are marked *