GoogleLesson 318Free preview
Google Charts
This lesson is part of How To · All levels
Summary
Google Charts is a JavaScript library for creating interactive graphics in a browser, such as bar diagrams, lines, and pie. The data is set up in a two-dimensional table, then the graph is drawn into the container element using the draw method. You can set the title, the color, the legend, and the axis through the options object.
Key points
- Load the Google Charts loader before you create a chart
- Provide container elements with a clear ID
- The data is organized as a row array with the first row containing the column title
- Call chart.draw(data, options) after the data is ready
- Select the type of graphics that corresponds to the data message
Full lesson
Code examples and quizzes
Full lessons, code examples, and quizzes are available to subscribers. 5 questions.