Lesson 7 Lab Visual Guide

PrintPrint

Lesson 7 Lab Visual Guide Index

  1. Introduction
  2. Required Data
  3. Data Cleaning and Formatting
  4. GIS Operations
  5. Tableau: Initial Steps in Displaying the Maps
  6. Tableau: Setting Up the Bivariate Map
  7. Tableau: Color Selection
  8. Save Your Tableau Project
  9. Tableau: Creating Charts
  10. Save Your Tableau Project
  11. Tableau: Dashboard
  12. Tableau: Linked Map and Charts
  13. Tableau: Dashboard Design Considerations
  14. Save Your Tableau Project
  15. Sharing and Publishing Your Tableau Projects

Lesson 7 Lab Visual Guide

  1. Introduction

    In this lab you will work with multivariate symbolization. Specifically, you will create a bivariate map, which allows you to show two variables at once. You will use one variable to display the data itself, and another to display margin of error related to the data. The margin of error fits within the idea of data uncertainty. As with Lab 6, you will continue using Tableau. For this lab, you will begin to explore the interactivity afforded by Tableau through ideas known as linking and brushing (connecting data relations on multiple interactive graphics). You will end the lab by creating a dashboard with a map and two charts with linked data, allowing you and other map viewers to hover over the mapped data and see related patterns simultaneously appearing on the maps and charts.

  2. Required Data

    For this lab, you can continue with the data you used in Lab 6. However, you can decide on a new dataset of your own choice. Regardless of the chosen dataset, it is important that you find data where an “uncertainty” category, like margin of error, is present (such as is available from the US Census Bureau). For this lab, you will map the data along with the uncertainty measure that is associated with that data.

    As with the Lab 6 visual guide, a sample dataset will be used to explain the map creation process in Tableau. You can certainly follow along with these instructions using this dataset or one of your choosing.

    Whichever data you use, place it in a Lab 7 folder.

    In Lab 6, I suggested that there may have been potential errors per county for my dataset about grandparents who live with their grandchildren in New Mexico. Using this dataset, I mapped the majority race per county with the highest percentage of grandparents living with grandchildren. Some of the numbers appeared a little confusing, so I am interested in visualizing the uncertainty of that grandparent data for Lab 7. I will pick one race for this lab, white, since that was the group with the highest percentage in most counties.

    For Lab 7, you will be creating one map and two (2) charts. The data for the two charts can come from the same census data; you do not need a separate csv!

  3. Data Cleaning and Formatting

    As with working in Lab 6, before working in Tableau, I cleaned my dataset in Excel. I removed unnecessary data leaving only three columns: county names, percentages of white grandparents living with children, and the margin of errors related to this percentage (Figure 7.1). Similarly, clean your data and leave only three columns (or more if you want to visualize additional data!), making sure to keep both the data itself and the error related to that data. If you are using your own data, it may be any numeric form (e.g., percents, rates, or totals).

    Try to clean your data with minimal instructions; it is important to internalize and learn these principles without following instructions every time. However, if you get stuck, then you can certainly review the instructions specified in Lab 6.

    Enter image and alt text here. No sizes!
    Figure 7.1: A screen-capture of the cleaned and formatted *.csv file. Look at the top row for variable names. In this file, the following headers have been included. Total, Total_MoE, and Total_White, and Total_White_MoE  represents the total number of grandparents living with their grandchildren (who are <18 years old), margin of error for the total count (a measure of uncertainty), percent white, and margin of error for the percent white, respectively.
    Credit: Fritz Kessler, Penn State University is licensed under CC BY-NC-SA 4.0(link is external).
  4. GIS Operations

    Using your cleaned *.csv file and relevant TIGER line shapefile in ArcPro GIS, make a join between the TIGER line file and the *.csv file. Join your *.csv data to the shapefile and export both a polygon and a centroid shapefile of your data for use in Tableau. Use logical file names. Again, if you need more detailed instructions on the join or export process, return to Lab 6.

    Below I list the files that I created. You should have a similar number of files for work in Tableau.

    1. Grandparents_MoE.csv (the cleaned and formatted data in .csv format)
    2. NM_Cnty.shp (the polygon shapefile that includes the joined data from the .csv file)
    3. NM_Cnty_Points.shp (the centroid point shapefile that includes the joined data from the .csv file)
  5. Tableau: Initial Steps in Displaying the Maps

    Open a new book in Tableau and add two Spatial Files: your polygon file and your centroid (point) file. As with the work in Lab 6, you will need to establish the relationship between the two files. Figure 7.2 illustrates this process. You carried out this same process in Lab 6.

    Enter image and alt text here. No sizes!
    Figure 7.2: Setting up the attribute relationship between the polygon and centroids shapefiles.
    Credit: Fritz Kessler, Penn State University is licensed under CC BY-NC-SA 4.0(link is external).

    Open your first sheet (Sheet 1 tab) and separately double click on “Latitude” and “Longitude” to display the grey scale world map. Drag the polygon “Geometry” to the Detail square on the Marks panel to begin your map. Second, drag the column containing the county names to the same square and panel.

    Drag a second “Longitude” to the Columns header at the top of the Tableau environment to duplicate your map. Once there, click on “Longitude,” and under the dropdown choose the Dual Axis option to again combine the two maps into one. Notice that there are two (2) Longitude listings appearing under the Marks panel (Figure 7.3).

    One of the two Longitude listings in the Marks panel will remain as-is to represent the polygon basemap (change the polygon fill color as you see fit). The other Longitude listing will be used to display your .csv data.

    Enter image and alt text here. No sizes!
    Figure 7.3: The appearance of the Marks pane listing two Longitude entries.
    Credit: Fritz Kessler, Penn State University is licensed under CC BY-NC-SA 4.0(link is external).

    Now, you will add the data of interest that you wish to map. On the non-basemap tab (the centroids point file), drag the “Percent” (not the margin of error) data to the Size square on the Marks panel. Change the Automatic option to Circle option in the dropdown menu. Proportional circles will display (Figure 7.4). At this stage, you can experiment with the circle size and the county color fill options, if you like.

    Enter image and alt text here. No sizes!
    Figure 7.4: A map showing proportional circles that report the percentage of grandparents living with their grandchildren who are <18 years old.
    Credit: Fritz Kessler, Penn State University is licensed under CC BY-NC-SA 4.0(link is external).
  6. Tableau: Setting Up the Bivariate Map

    We want to make a bivariate map that shows the percentage and error data. For the symbols to represent two variables we will use the visual variables size and color. Drag the margin of error data from the centroid table onto the “Color” square on the same panel. You should see the interior fills of the circles change from a solid fill to a color gradient from light to dark. As with cartographic convention, light colors are associated with a low margin of error and dark colors representing a high margin of error.

  7. Tableau: Color Selection

    Click on the arrow next to the color ramp on the right-hand side and click “Edit Colors” to determine if you would like to display your data using a different color scale (Figure 7.5). In my case, I chose a white to purple color scheme, changed the polygon county fill color to a light green, and reversed the margin of error colors. The decision to reverse the margin of error color assignment is derived from what the margin of error values report. With the margin of error values, lower values indicate higher confidence or lower uncertainty while higher values indicate lower confidence or greater uncertainty in the data. Traditionally, brighter hues represent “higher” values. However, I wanted to use brighter colors to highlight the counties with the greatest margin of error (suggesting more uncertainty) to draw attention to that error. Figure 7.5 shows the map with the assigned colors. Notice in Figure 7.5 that the color scheme order has been reversed and the circle sizes have been increased to help visualize the color lightness difference within the data.

    Enter image and alt text here. No sizes!
    Figure 7.5: A map showing the proportional circles and the gradient fill colors representing the margin of error values for the percentage of grandparents living with their grandchildren <18 years old. Note that a complimentary county polygon fill color has been assigned.
    Credit: Fritz Kessler, Penn State University is licensed under CC BY-NC-SA 4.0(link is external).

    At this point the map for this lab is almost done. You will eventually be displaying it alongside two bar charts, so take some time to take a critical look at the map design. Note that the design shown in Figure 7.5 is not well done. Take a critical look at your map design at this stage. Consider resizing the symbols, modifying all colors, and editing all titles and labels. Do not simply copy the design shown in Figure 7.5!

  8. Save Your Tableau Project

    Before continuing, you should also save the book as “Lab 7”. For example, you could consider saving this part of the exercise as Lab_7_Dashboard.

  9. Tableau: Creating Charts

    For my particular dataset, there are two counties (Colfax and De Baca) where there are no grandparents of white majority reported that live with their grandchildren. However, I still want to be able to see the margin of error data for all counties, so I am going to create two charts to display with my map.

    To begin, create a new sheet in the same Tableau Book. To create a new Sheet, click on the small plus icon to the right of Sheet 1 tab at the bottom left-hand corner. Title the new sheet something logical like “Chart 1”.

    The same .csv data from the map is also accessible from the new sheet. Drag the percent grandparent data to Columns on the top and the County Name data to “Rows” (Figure 7.6).

    For this data, let’s visualize it as squares (you can use circles or other shapes) on a scatter plot. Under the Marks panel, change the “Automatic” to “Squares.” Doing so will automatically create square marks on a scatterplot (Figure 7.6).

    Depending on your data, you could visualize it using a different chart type instead (e.g., vertically aligned bar chart). Think about what makes sense with your data. In my case, for example, a line chart probably does not make sense here since neither change over time nor different categories are being represented (doing so would create connections between the data that don’t exist).

    Enter image and alt text here. No sizes!
    Figure 7.6: A scatterplot of the percent of white grandparents (x-axis) who live with their grandchildren <18 years old by county (y-axis).
    Credit: Fritz Kessler, Penn State University is licensed under CC BY-NC-SA 4.0(link is external).

    Notice along the x-axis, the grandparent data is presented numerically according to the alphabetical order of the county names along the y-axis. While this order may make sense, the numeric relationships in the grandparent data are not well visualized. A more meaningful depiction of the grandparent data would be to arrange that data numerically, irrespective of the order of county names along the y-axis. To reorder the grandparent data numerically, look along the top of the chart’s y-axis (below the chart title, Chart 1), click the down arrow, then Field, and source the data numerically (Figure 7.7). This action will re-arrange the order of the dots from low to high (or visa-versa). Figure 7.8 shows the re-arranged dots in numerical order.

    Enter image and alt text here. No sizes!
    Figure 7.7: The option to re-arrange the dots in numerical order.
    Credit: Fritz Kessler, Penn State University is licensed under CC BY-NC-SA 4.0(link is external).
    Enter image and alt text here. No sizes!
    Figure 7.8: The numerically ordered percentage data of white grandparents who live with their grandchildren <18 years old.
    Credit: Fritz Kessler, Penn State University is licensed under CC BY-NC-SA 4.0(link is external).

    Follow the same steps from the first chart to make a second chart, this time using the margin of error data. Try something different here and use a bar chart instead of a scatterplot to represent the margin of error data. Stylize and label the resulting chart appropriately (e.g., add a descriptive title, change legend titles, etc.). The two charts should not use the same colors. Consider assigning colors based on the color choices you assigned to the variables in the map. The charts do not represent the same data, so their appearance should be unique. Regardless, ensure consistency between the various elements of both charts and the map (edit the titles, colors, and legends).

  10. Save Your Tableau Project

    Before continuing, you should also save the book as “Lab 7”. For example, you could consider saving this part of the exercise as Lab_7_Dashboard.

  11. Tableau: Dashboard

    Now, we will place all three visuals together on a single dashboard. On the bottom of the screen, next to where you usually create a new sheet, select New Dashboard instead (Figure 7.9).

    Enter image and alt text here. No sizes!
    Figure 7.9: The blank dashboard environment.
    Credit: Fritz Kessler, Penn State University is licensed under CC BY-NC-SA 4.0(link is external).

    On the left table of contents, under the Size heading, select a screen size for your design. Select an option where you can see everything at once without scrolling. This may take some experimentation, and you can revisit this option later once you place all of the elements on the dashboard.

    Below Size, look under Sheets. Separately drag each of your three sheets into the layout. Drag the “Map” first and then bring the other two sheets onto the layout. Note that as you drag an individual sheet around the dashboard environment, containers will appear, letting you know where these sheets will appear and their size. You can always resize each sheet. The legends will automatically be added (Figure 7.10).

    Enter image and alt text here. No sizes!
    Figure 7.10: The dashboard environment with the three sheets placed: map, percentage of grandparents living with their grandchildren <18 years old scatterplot, and margin of error scatterplot.
    Credit: Fritz Kessler, Penn State University is licensed under CC BY-NC-SA 4.0(link is external).

    This appearance isn’t terrible, but it’s hard to see all the data on the tables (the map is too large, and the charts are compressed). Maybe a better appearance would result if we flipped the columns and rows on the tables. Luckily, Tableau has an easy way to do this. Individually return to each of your chart’s sheet and click “Swap Columns and Rows” button at the top of the screen (Figure 7.11).

    You can individually change any element, design, or data on the map or charts at any time in the appropriate sheet and those changes will be updated on the dashboard!

    Enter image and alt text here. No sizes!
    7.11: Swap rows and columns button and result for each chart.
    Credit: Fritz Kessler, Penn State University is licensed under CC BY-NC-SA 4.0(link is external).

    The dashboard is looking better (Figure 7.12) and most of the counties are now visible on the tables. However, the map legends are taking up a lot of space in the middle of the display. Click on it so the editing features appear and grab the blue rectangle with two white lines to drag it somewhere else. In Figure 7.13, the two map legends have been moved to a position below the map. Note that, when moving these elements, the other elements’ sizes automatically adjust.

    You can drag each of the sheets by their sides to change their sizes, or you can click the arrow on the top right side of each for “More Options” and the “Edit Width” by typing a number.

    The chart titles and label appearances (e.g., text sizes) can also be edited. You may feel that the type sizes for both axes should be made smaller. Specifying smaller text can help conserve a bit more on space allocation of the map and charts on the dashboard.

    Y-Axis Label

    In Figure 7.12, notice that the y-axis is labeled. However, that label is a bit cryptic (e.g., "Grandpar 7 (NMCnt..)"). You can edit the label to make it more understandable. To edit the label, make sure that you are in the chart's worksheet and not the dashboard. It is easier to perform the edits in the worksheet rather than the dashboard. To edit the label, right-click on the label text and choose the Edit Axis option. The Edit Axis window appears. Look over the contents of the window. Under the Axis Title heading, double-click the label text which will highlight. Change the label to something more sensible. The y-axis label will update. 

    X-Axis Label

    The x-axis label is a bit more involved. Instead of referring to the x-axis label as a label, Tableau calls it a "Caption." Regardless of the terminology, the caption can be edited. By default, the x-axis caption is disabled. To enable the caption, move your cursor to the lower-left portion of the chart (below the y-axis text) and right-click. On the menu that appears, enable the Caption option. The caption appears. Inside the caption area, right click and choose the Edit Caption option. The Edit Caption window appears. Change the caption's wording to something more readable. Make sure to center align the caption. Style the text to have the same appearance as the y-axis. When you are finished, select Apply and Ok. The caption will appear below the chart and serve as the x-axis label. 

    Repeat the editing process on the other chart's y- and x-axes labels. 

  12. Enter image and alt text here. No sizes!
    7.12: The Tableau dashboard with the swapped rows and columns of the individual scatterplots.
    Credit: Fritz Kessler, Penn State University is licensed under CC BY-NC-SA 4.0(link is external).

    Enter image and alt text here. No sizes!

    7.13: The location of the two map legends now positioned below the map.
    Credit: Fritz Kessler, Penn State University is licensed under CC BY-NC-SA 4.0(link is external).
  13. Tableau: Linked Map and Charts

    Now that the map and charts have been created, we need to establish the “link” between the three sheets. To begin, look at the top of the screen, click on the “Dashboard” menu item along the top of the Tableau environment and select “Actions…” The Actions window appears (Figure 7.14). On this window, look under “Add Actions” and click the “Highlight” option. The Add Highlight Action window appears.

    Enter image and alt text here. No sizes!
    Figure 7.14: The Actions window.
    Credit: Fritz Kessler, Penn State University is licensed under CC BY-NC-SA 4.0(link is external).

    On the Highlight window, name the action “Hover.” Under “Run action on” change the type to “Hover” as this specifies the kind of action that Tableau will look for with your cursor. Under “Targeted Highlighting” click “Selected Fields” and select the field that contains the name of your counties (Figure 7.15).

    Enter image and alt text here. No sizes!
    Figure 7.15: The Add Highlight Action window and options for setting up the Linked Actions via the “Hover” option.
    Credit: Fritz Kessler, Penn State University is licensed under CC BY-NC-SA 4.0(link is external).

    Click OK on the Add Highlight Action and Action windows. Now, when you hover over a data point on one of the three sheets, it will be highlighted on the other two sheets (Figure 7.16).

    Note that I have the data sorted where the counties with the least errors appear first. Instead, I would rather see the data with the greatest amount of uncertainty first. I need to reverse the charts back in the Sheets section. Remember, you can always edit your charts more to fit the scope of your dashboard story.

    Enter image and alt text here. No sizes!
    Figure 7.16: The linked action between the map and two scatterplots. Hovering over the square in the margin of error chart for Roosevelt automatically links to the same data in the percent grandparents chart and map.
    Credit: Fritz Kessler, Penn State University is licensed under CC BY-NC-SA 4.0(link is external).
  14. Tableau: Dashboard Design Considerations

    Notice that not all the counties are visible in the scatterplots’ x-axis. You can individually change the dimension of each object in several ways. First, you can manually adjust the width and height of each object by moving your cursor to the edge of each object. Your cursor will change to a double-sided (left-to-right) arrow. Click and drag your cursor adjusting the dimension of the object. You can also right-click on an object which brings up a menu. On this menu, choose the Fit option. You can choose to Fit the width, height, etc. (Figure 7.17).

    Consider changing the type size, type face, and type style on each object to make the type more readable, present a different appearance, or ensure consistency between all objects in the dashboard. You can change the type specs under the main menu Format and then the Font option. Figure 7.18 shows a better dimension for each element that improved readability of the different elements.

    Enter image and alt text here. No sizes!
    Figure 7.17: the Fit option (thrid from top) to automatically “fit” the dimension of an element to the dashboard widow.
    Credit: Fritz Kessler, Penn State University is licensed under CC BY-NC-SA 4.0(link is external).
    Enter image and alt text here. No sizes!
    Figure 7.18: The size of the individual objects has been adjusted to allow for better readability.
    Credit: Fritz Kessler, Penn State University is licensed under CC BY-NC-SA 4.0(link is external).

    Find empty space in the dashboard and add metadata and a short textual description of the data and any patterns you see.

    Figure 7.19 gives you a general idea of what your final dashboard should look like. Your design should be different! This is a published version of the dashboard. Note that while the dashboard in Figure 7.19 includes all of the requested elements. However, the overall design leaves much to be desired!

    Enter image and alt text here. No sizes!
    Figure 7.19: A published version of the dashboard. Note the design is not very consistent or engaging.
    Credit: Fritz Kessler, Penn State University is licensed under CC BY-NC-SA 4.0(link is external).
  15. Save Your Tableau Project

    Before continuing, you should also save your Tableau project as “Lab 7” or "Lab_7_Dashboard."

    You should now have three separate Tableau sheets and one dashboard inside your project that correspond to the individual parts of this lab.

  16. Sharing and Publishing Your Tableau Dashboard

    Once you're happy with the design of your map and charts, you can ready publish the dashboard to Tableau Public which will allow anyone to view it. Make sure you have saved your workt! Again, to save your maps to Tableau Public, you will need to sign into (or create) your Tableau Public account.

    By now, you should have saved each of your sheets. It is the dashboard link that you will share with me and others in the class. The Share link is available through the share button found in your published dashboard inside Tableau Public. To share your dashboard, look along the top right list of icons for the share icon (Figure 7.20). Selecting the Share link button opens the Tableau Share window (Figure 7.21). On the share link window, copy the URL address inside the Link textbox and include this link in your submission.

    If you make changes to your any parts of your charts or map, you will need to save each and then "re-publish" it at any time. Once re-published, the changes will automatically be applied to the online version. You will not need to re-share the dashboard URL.

    Enter image and alt text here. No sizes!
    Figure 7.20: The Tableau share icon.
    Credit: Fritz Kessler, Penn State University is licensed under CC BY-NC-SA 4.0(link is external).
    Enter image and alt text here. No sizes!
    Figure 7.21: The Tableau Share window. Copy the URL listed inside the Link text box for your dashboard and submit the link.
    Credit: Fritz Kessler, Penn State University is licensed under CC BY-NC-SA 4.0(link is external).