Getting started with a pie chart
In this first recipe, we will start with Google Charts, covering the basic steps that you need to understand when working with Google Charts through an interactive dataset that is based on the CDC death rates in the USA (LCWK)—deaths, percent of total deaths, and death rates for the 15 leading causes of death in five-year age groups, by race and sex in the United States in 2008.
Getting ready
We will start from scratch with an empty HTML file and an empty JavaScript file named 08.01.getting-started.html
and 08.01.getting-started.js
.
How to do it...
Let's list the steps required to complete the task starting with the HTML file:
Let's start by creating a
head
and linking it to the Googlejsapi
and our local JavaScript file:<!DOCTYPE html> <html> <head> <title>Google Charts Getting Started</title> <meta charset="utf-8" /> <script src="https://www.google.com/jsapi"></script> <script src="./08...