Answering questions using Show Me chart types

Of the many chart types available in the Show Me tool in Tableau Public 9.x, there are several common chart types that are frequently used—tables, line charts, bar charts, geographic maps, and scatter charts. Pie charts are often used in popular culture, particularly in infographics, but you should use them sparingly and always label the slices with the percent of the total.

Charts and graphs exist to answer questions, and some charts can naturally answer certain types of questions better than other charts.

The following sections discuss in detail some important chart types offered in Tableau Public, but this is not a comprehensive list due to limitations pertaining to space in this book. In order to help you learn how to construct different visualizations, the screenshots in these sections include the placement of different fields on the shelves and cards of the workspace.

About dimensions and measures

In Chapter 3, Connecting to Data, we discussed dimensions and measures in detail. Let's bring up a few more points so that we understand the chart creation process a little better. Tableau Public separates data source into dimensions (qualitative fields) and measures (quantitative fields).

When you drag a field onto a worksheet, its new instance is called a pill. The dimensions and discrete fields will be blue, while continuous measures will be green pills. Each of these pills has a right-click on the shortcut context menu and can have icons on them that correspond to the Marks card shelves that they belong, to as well as the set and group icons (if they are part of a group or set).

When we use a dimension, Tableau Public creates column or row headers for a chart (view). On the contrary, measures typically create an axis in the chart in case the measure is classified as continuous, as described in the next section of this chapter. Measures can be aggregated (mathematical calculations such as summation, averaging, counting, and so on) based on the selected aggregation function (SUM, AVG, COUNT, and so on) for each item in the dimension used in the chart.

Tableau Public automatically determines whether a data field is a dimension or a measure, but sometimes, the software makes mistakes. For instance, if your data source has numeric unique identifiers, such as account numbers, then they will be grouped as measures by default, unless the field name contains the ID string. In this case, you can change a data element to either a dimension or measure by dragging it to the correct pane in the Data window (to the Dimensions pane or the Measures pane). It is more likely that you will have to convert measures into dimensions (because all numeric values are not measures). To convert a measure into a dimension, you can either drag it to the Dimensions pane or right-click on the measure and select Convert to Dimension from the shortcut context menu. If this conversion is needed for only one chart, you can locally convert the measure on a shelf in the same manner (by selecting the Convert to Dimension command from the shortcut context menu).

Continuous and discrete dimensions and measures

As learned in the previous section, all data elements are classified in Tableau Public as either a dimension or a measure. These dimensions and measures are further classified into continuous or discrete elements.

The data elements in the Data window and on the shelves in Tableau Public are either light green or light blue in color. The green color indicates that a data element is set to continuous, and the blue data elements are set to discrete elements. A green or blue outline will also appear when selecting the corresponding continuous or discrete data elements. When you are building charts in Tableau Public and adding dimensions and measures to the Columns and Rows shelves, the continuous data items (usually measures) will create axes, and the discrete elements will create row or column headers.

Discrete and continuous designations for data elements affect how graph elements are built and marks and axes are rendered. For example, a continuous date dimension used in a line chart will create a traditional, unbroken line chart. Using a discrete date dimension will create a line chart with segmented panes, that is, lines that are broken apart with each change in the date part. For instance, for a graph that shows years and months, the lines will break between each year. Using continuous measures on the Color shelf will result in a color gradient being used in the chart, with the hue or color in proportion corresponding to the value of the measure. If a discrete measurement is used on the Color shelf, the color will not be a gradient but separate colors (this is generally fine for dimensions on the Color shelf, but not for measures). Have a look at the following screenshot to see the difference between using a discrete color and a continuous color.

In this example, we're using a continuous measure to color each cell. Note that on the Marks card, AVG(Measure) is green. This means that it's continuous. Region, as compared to AVG(Measure), is blue because it's a discrete dimension (check out the next screenshot):

Continuous and discrete dimensions and measures

We converted AVG(Measure), which is the average CO2 emissions per capita in 2010, into a discrete number by clicking on its context menu on the Marks card and then selecting Discrete, as shown in following screenshot. This version assigns a unique color to every numerical value:

Continuous and discrete dimensions and measures

Similarly, if a continuous measure is used on the Size shelf, the sizes of the graph marks such as circles, squares, or other shapes, will be in proportion to the value of the measure. Discrete measures used in the Size shelf can have a more pronounced size variation, but you can experiment with changing the continuous or discrete settings for measures and dimensions to better understand their effect on the chart. In my opinion, using discrete measures on the Size shelf can sometimes yield good results.

Measures and dimensions can be converted from continuous elements to discrete and vice versa. This allows you to experiment and customize the chart view. Quite often, you will convert continuous elements to discrete elements, as you will also often convert measures to dimensions. You can convert continuous elements to discrete ones by right-clicking on the date element and selecting the Convert to Discrete menu option. Also, when you move a data element from the Measures pane in the Data window to the Dimensions pane, it will typically convert the date element from continuous to discrete.

Just like changing data items from measures to dimensions only in one chart, you can also change from continuous to discrete for only the desired chart instead of making the change globally for all the charts and worksheets in the workbook.

Selecting aggregation types for measures

Measures can be aggregated. These numeric values can be added, counted, and averaged, and the median can be chosen. In addition, the aggregation types that are available in Tableau Public also include statistical functions such as maximum and minimum selection, variance, standard deviation, and percentile. The most common aggregation types used in journalism and blogging are sum (addition), average, and count. The count aggregation is useful when you have a data source with rows that have an ID field, such as the FIPS ID, which is a numerical identifier for a specific geographic area, such as a county. To get a count of records, use Count(ID), where the ID is the specific ID name in your data source. Extending this example, you can also use Count(Distinct) when you only want a count of every unique ID and don't want to count the repeating IDs.

Selecting the aggregation type for measures can be done by right-clicking on a measure from the context menu, choosing the Measure command, and clicking on the desired aggregation type. You can also access aggregations from the drop-down menu by clicking on the tiny arrow on the right-hand side of the data element pill. The following is a screenshot of the full aggregation menu that is available from a measure pill's right-click on the shortcut context menu:

Selecting aggregation types for measures

Swapping and sorting

Columns and rows can be swapped (one for another) by using the Swap button in the menu bar. Items on shelves can also be moved manually among shelves and to and from the Data window. Dimensions and measures can be duplicated by pressing Ctrl key and dragging to a new or the same shelf. This is helpful when changing aggregations for a duplicate date element or part of the date (such as changing year to month).

Similarly, you can sort fields in the following three ways:

  • Right-click on the field in the Data window, click on Default Properties, and select Sort, which sets the default sort order but does not allow you to sort by a measure
  • Click on the context menu of a pill on your visualization and select Sort
  • Click on the ascending or descending sort buttons in the toolbar, or hover over a header and click on the appropriate icon

For instance, in the following screenshot, the countries in each region are sorted in the descending order by the CO2 emissions per capita. If you click on the quick sort icon that we have highlighted, the countries in each region will be sorted again in an alphabetical order. Conversely, when you hover over the x axis and click on the sort button, they will be sorted in the ascending order by the measure being used:

Swapping and sorting
..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset