Lesson 3: Making Data Visualizations

Overview

Now that students have had the chance to see and evaluate various data visualizations, they will learn to make visualizations of their own. This lesson teaches students how to build visualizations from provided datasets. The levels in Code Studio provide a detailed walkthrough of how to use Google Sheets to create several different kinds of charts. While this lesson focuses on the Google Sheets tool, other tools may be substituted at the teacher’s discretion, and MS Excel support is coming soon to the lesson.

The main activity teaches students to build different chart types (scatter, line, and bar charts) from a single data set. It should be emphasized to students that the purpose of this lesson is to explore and experiment with creating different types of visualizations, not to build the perfect chart. Students will have a chance to create and customize their own charts. At the end of class, students compare their custom visualizations with those of their classmates.

Purpose

Being able to create meaningful data visualizations is extremely important in order to effectively communicate information about large data sets. It's also important to be able to use visualizations to simply “look” at data that is too complex to make sense of by looking at the raw data alone. Any computer scientist working with data should have some skills and facility with producing visualizations of the data to get a sense of what it contains. Visualizing the data allows you to see patterns, trends or relationships you might otherwise not.

The most important piece of this lesson is not learning to create the prettiest chart; it’s about using charts to “tell the story” of what’s really going on in the data. Different charts are more or less appropriate for communicating this story, depending on the data. The point of having students explore different chart types is to help them build visualizations that reveal trends or connections in the data that are too hard to see by just looking at a data table in a spreadsheet.

Agenda

View on Code Studio

Objectives

Students will be able to:

  • Select the appropriate type of data visualization to discover trends and patterns within a dataset.
  • Create a bar, line, and scatter chart from a dataset using a computational tool.
  • Use the settings of a data visualization tool to manipulate and refine the features of a data visualization.

Preparation

Links

Heads Up! Please make a copy of any documents you plan to share with students.

For the Students

Teaching Guide

Getting Started

Survey Reminder

Survey Reminder: Give students a few minutes to fill out the class tracker survey that you started in Lesson 7 - Introduction to Data.

Discussion Goal

We want to motivate students' desire to create some visualizations on their own. Build on the "Good/Bad Visualiztions" lesson. Some responses students might give:

  • A large data set is too big to understand by looking at a table in a spreadsheet.
  • Creating a data visualization with a computer is faster and more accurate than creating one by hand.

Using visualization to discover connections and patterns

Prompt:

"Do you have to use a computer to create a data visualization? What are some reasons that you need to use a computer to manipulate data?"

Briefly Share and discuss responses

  • Do a quick think-pair-share (or other strategy)

Transitional Remark

Taking data from its raw state to the point where you can create a meaningful visualization involves several steps. Today we’re going to use visualization in attempt to discover things in the data we might not otherwise see.

It takes practice to create good visualizations. Today, we’ll get our feet wet by learning to create charts using Google Sheets.

Make a Quick Visualization

warm up goal

This is intended to only be a brief activity to illuminate issues around making visualizations and how much variety there can be, and letting the students be creative and share with each other.

Remarks

When trying to understand data, having a visualization, or picture of it, is often much more effective at communicating information than the raw data itself.

Making a good visualization of data is often challenging but can be fun and very creative, and we're about to start making our own. Let's try one, quickly.

Scenario:

Teaching Tip

Please note: this data is completely fabricated and is only intended to serve the purposes of the warm up. It is intentionally slightly ambiguous. If students ask questions seeking clarification that's a good sign, but you might have to simply respond: "Well, this is the data we have".

There are no right or wrong answers here as long as students attempt to represent the data in a different way somehow.

Here is some data: On some survey 2,000 people were asked, "What do you do when you're bored?". Here are the most common responses by age group.

age most common response number out of
18 and under texting 157 500
19-64 watching TV 247 1200
65+ reading 54 300
all ages talking with friends 451 2000

For example: of the 1200 people surveyed between the ages of 19-64, 247 said "watching TV" which was the most common of any other responses to the question for that age group.

Prompt:

  • "Take a few minutes by yourself and try to make a visual, graphical, explanation of this data. Try to communicate something about through drawing while remaining true to the results of the data."

  • Give students 3-5 minutes to draw.

Compare and Discuss:

  • Have students compare what they drew with an elbow partner and point out similarities and differences.

Prompts:

  • "In this exercise what was challenging?"
  • "What kinds of things were visually effective at communicating information?" <-- ALT: "What where the characteristics of the visualizations that effectively communicated this information visually?"

Activity

Teaching Tip

Remember the point here is not to make the prettiest chart, but choose the chart type that makes the most sense for the data you've got and the story you're trying to tell.

You can also point out to students that finding “no correlation” or “no relationship” is actually just as interesting as finding a strong correlation or relationship. For example, if you examine the difference between men and women in average rating of Star Wars, you will see virtually no difference! That’s interesting!

Make scatter, line, bar, and custom charts

Transition to Making Data Visualizations on Code Studio

  • The "Activity Guide" for this lesson is all laid out in Code Studio.
  • Put students into pairs and send them to Code Studio.
  • The steps students go through are laid out below.
  • Please note the purpose and teaching tips on this lesson for perspective.

While students are working, circulate the room to help and encourage.



Teacher Code Studio Reference
Students are asked to make a copy of the data set in their Google Drive. (Students must be logged into Google Drive for this step to work.) When they open the link to the CSV file, they can click the “Open” button next to the green Google Sheets logo, which will make a copy of the CSV in their personal Drive folder.
Students follow step-by-step instructions to create a scatter plot showing the average movie rating by age of reviewer
Students follow step-by-step instructions to create a line chart showing the average movie rating by age of reviewer, broken down by gender.
Students follow step-by-step instructions to create a bar chart showing the number of ratings by age of reviewer, broken down by gender.
Students experiment with creating their own charts on the same data set
NOTE: they’ll get a chance to explore many different data sets in the next lesson. It should be emphasized that the purpose of this part of the lesson is to freely explore the chart tool and discover connections in the data; students should not fixate on creating the perfect chart.

Wrap-up (10 mins)

Compare with a partner

With partners or in small groups, have students discuss the following prompt. Once students have shared with each other, have students report back to the class about the charts they made and what they learned.

Prompt: What was the most interesting visualization you were able to create? What did it help you discover about the data?

Assessment

Assessment Possibilities

  • Score or review a written response to the reflection prompt from the wrap up (also found in code studio)

  • Make a simple rubric (a checklist basically) for the steps of the activity that students were supposed to go through:

    • Scatter Plot
    • Line Chart
    • Bar Chart
    • Optional: something on their own

Extended Learning

If you want additional sources of data visualizations, consider the following sources:

Standards Alignment

View full course alignment

Computer Science Principles

1.2 - Computing enables people to use creative development processes to create computational artifacts for creative expression or to solve a problem.
1.2.5 - Analyze the correctness, usability, functionality, and suitability of computational artifacts. [P4]
  • 1.2.5A - The context in which an artifact is used determines the correctness, usability, functionality, and suitability of the artifact.
  • 1.2.5B - A computational artifact may have weaknesses, mistakes, or errors depending on the type of artifact.
  • 1.2.5C - The functionality of a computational artifact may be related to how it is used or perceived.
  • 1.2.5D - The suitability (or appropriateness) of a computational artifact may be related to how it is used or perceived.
3.1 - People use computer programs to process information to gain insight and knowledge.
3.1.1 - Use computers to process information, find patterns, and test hypotheses about digitally processed information to gain insight and knowledge. [P4]
  • 3.1.1D - Insight and knowledge can be obtained from translating and transforming digitally represented information.
  • 3.1.1E - Patterns can emerge when data is transformed using computational tools.
3.1.2 - Collaborate when processing information to gain insight and knowledge. [P6]
  • 3.1.2A - Collaboration is an important part of solving data driven problems.
  • 3.1.2B - Collaboration facilitates solving computational problems by applying multiple perspectives, experiences, and skill sets.
  • 3.1.2C - Communication between participants working on data driven problems gives rise to enhanced insights and knowledge.
  • 3.1.2D - Collaboration in developing hypotheses and questions, and in testing hypotheses and answering questions, about data helps participants gain insight and knowledge.
  • 3.1.2F - Investigating large data sets collaboratively can lead to insight and knowledge not obtained when working alone.
3.1.3 - Explain the insight and knowledge gained from digitally processed data by using appropriate visualizations, notations, and precise language. [P5]
  • 3.1.3A - Visualization tools and software can communicate information about data.
  • 3.1.3B - Tables, diagrams, and textual displays can be used in communicating insight and knowledge gained from data.
  • 3.1.3C - Summaries of data analyzed computationally can be effective in communicating insight and knowledge gained from digitally represented information.
  • 3.1.3D - Transforming information can be effective in communicating knowledge gained from data.
  • 3.1.3E - Interactivity with data is an aspect of communicating.

CSTA K-12 Computer Science Standards (2017)

DA - Data & Analysis
  • 3A-DA-11 - Create interactive data visualizations using software tools to help others better understand real-world phenomena.
  • 3B-DA-05 - Use data analysis tools and techniques to identify patterns in data representing complex systems.
  • 3B-DA-06 - Select data collection tools and techniques to generate data sets that support a claim or communicate information.
  • 3B-DA-07 - Evaluate the ability of models and simulations to test and support the refinement of hypotheses.
IC - Impacts of Computing
  • 3A-IC-25 - Test and refine computational artifacts to reduce bias and equity deficits.