*Data Visualization Tutorial


There are many different kinds of charts that are used to visualize data. In this lesson, you will learn to make scatter, line, and bar charts, but there are many other types of visualizations that people use to interpret data in different ways. Look through the Data Visualization 101 Guide and familiarize yourself with the different chart types, paying particular attention to the scatter, line, and bar charts.

Do This: First, make sure you are logged into your Google Drive account. Then, click the link below to see the data set you will be using: MovieRating_avgRatingByAgeByGender.csv To make your own copy in your local Google Drive, click the "Open" icon:

Making a Scatter Chart

The first type of chart you're going to build is a scatter chart. Scatter charts are useful for finding relationships between two types of data. In this exercise, you will build a scatter chart that shows the relationship between movie reviewer age and average movie rating.


Select Data For Scatter Chart

Do This: Select the "age" and "avg rating" columns, as show below.

Select the "age" and "avg rating" columns.Hint: To select an entire column, click the top cell (ex. A1), then hold down the "SHIFT" key and select the last cell from the last column you want (ex. B62).

Insert Scatter Chart

Google gives suggestions of what kind of chart you can make from your data, but for this exercise you're going to ignore those suggestions and make the chart yourself.
Do This:


Do A Visual Check Of Scatter Chart

At this point, your chart should look something like this:

Do This: Take a moment to look at your visualization. You can switch between "View" and "Edit" mode with this button:


Making A Line Chart

You can use many different kinds of charts to look at the same data. You'll now investigate different columns of your data with a line chart. Line charts are helpful for showing the progression of values over time. In this case you will be showing how the average movie rating changes with the reviewer's age.

Select Data For Line Chart

Do This: Select the "age," "avg rating women," and "avg rating men" columns. Select the first column of data using the mouse. Hold down the "Control" key, (or "Command" on a Mac) and select the additional columns of data. To select cells in non-adjacent columns, you need to use some fancy hotkeys:

  1. First select the cells from the first column (i.e., A1 through A62) using the SHIFT+click combination.
  2. Then, hold down COMMAND (if using a Mac) or CONTROL (if using Windows) and click to select the first cell of the next column (i.e., D1).
  3. Finally, hold COMMAND/CONTROL and SHIFT simultaneously, then click to select the last cell in the new column (i.e., D62).
  4. Repeat steps 2-3 for any additional columns you want to select (i.e., F1 through F62).

Select the cells to include in the chart.

Insert Line Chart

Do This:


Change chart type and insert your line chart into the spreadsheet.

Do A Visual Check of Your Line Chart

At this point, your chart should look something like this:

Once your chart looks close to the one above, switch to View mode and take a moment to look at your visualization.


Making A Bar Chart

In this exercise, you will use some different columns in the spreadsheet to create a bar chart. Bar charts are useful for viewing data grouped by different categories.

Select Data For Bar Chart

Do This:


*Select the "age," "number of women," and "number of men" columns.

Insert Bar Chart

Do This:


Change chart type and insert your bar chart into the spreadsheet.

Do Visual Check Bar Chart

At this point, your chart should look something like this:


Give Your Chart A Make Over

You've now successfully learned to create charts! Now you'll learn to further customize the appearance of your chart, which will make your visualization easier to read and understand. This exercise will walk you through the steps to customize the line chart you created earlier, but these same steps can be applied to any charts you make in the future.

Chart Title

A good chart title should effectively summarize the data story in the chart. You can change the title of your chart by double-clicking it.
Do This: Change the title of your line chart to "Average Rating by Age of Reviewer (<Your Initials>)" where <Your Initials> are the initials of your name.

Axis Labels

Your chart should include labels that indicate what the axes represent. Include measurement units, if applicable. Do This: Rename your horizontal axis to "Age (years)" and your left vertical axis to "Movie Rating". Hint: You will need to right-click the chart to access the axis labels.

Legend

You may notice that the labels in your legend are not very official-looking. To change the text that appears on the chart, you have to change the text in the column headers themselves. Do This: Change the legend labels to "Avg. Rating: Women" and "Avg. Rating: Men". Note: If you can't read your legend labels because the text is overlapping, try adjusting the style (bold, italics, etc.) of your legend.

Ranges

Examine both the far right and far left sides of your chart. Notice that both the men's and women's lines do not run continuously across the entire graph. The men's line has a gap on the left side of the chart, and the women's line ends shortly after age 55 and only has a few dots after that. These discontinuities appear because there are gaps in the data set. Do This:






* Wording, concepts, and materials for parts of this tutorial were taken from educational material provided by code.org under the Creative Commons Attribution-NonCommercial-ShareAlike 4.0 Unported License .