Search icon CANCEL
Subscription
0
Cart icon
Your Cart (0 item)
Close icon
You have no products in your basket yet
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Conferences
Free Learning
Arrow right icon
Arrow up icon
GO TO TOP
HTML5 Graphing and Data Visualization Cookbook

You're reading from   HTML5 Graphing and Data Visualization Cookbook Get a complete grounding in the exciting visual world of Canvas and HTML5 using this recipe-packed cookbook. Learn to create charts and graphs, draw complex shapes, add interactivity, work with Google maps, and much more.

Arrow left icon
Product type Paperback
Published in Nov 2012
Publisher Packt
ISBN-13 9781849693707
Length 344 pages
Edition 1st Edition
Languages
Tools
Arrow right icon
Author (1):
Arrow left icon
Ben Fhala Ben Fhala
Author Profile Icon Ben Fhala
Ben Fhala
Arrow right icon
View More author details
Toc

Table of Contents (17) Chapters Close

HTML5 Graphing and Data Visualization Cookbook
Credits
About the Author
About the Reviewer
www.PacktPub.com
Preface
1. Drawing Shapes in Canvas 2. Advanced Drawing in Canvas FREE CHAPTER 3. Creating Cartesian-based Graphs 4. Let's Curve Things Up 5. Getting Out of the Box 6. Bringing Static Things to Life 7. Depending on the Open Source Sphere 8. Playing with Google Charts 9. Using Google Maps 10. Maps in Action Index

Using a doughnut chart to show relationships


The doughnut chart is a fancy pie chart. So if you haven't created a pie chart yet, I strongly encourage you to revisit the previous recipe, Creating a pie chart. A doughnut chart is a layered pie chart. This chart is ideal for condensing the comparable data between data types that would fit into a pie chart:

Getting ready

We are going to grab our code from the last example and adjust it to fit our needs. So we will start with the same HTML file and the same code from the last example.

How to do it...

Perform the following steps:

  1. Let's update our data with some dummy data (we will create two data objects):

    var data1= [	{label:"Asia", value:3518000000,style:"#B1DDF3"},
      {label:"Africa", value:839000000,style:"#FFDE89"},
      {label:"Europe", value:803000000,style:"#E3675C"},
      {label:"Latin America and Caribbean", value: 539000000,style:"#C2D985"},
      {label:"North America", value:320000000,style:"#999999"},
      {label:"Near East", value:179000000,style:...
lock icon The rest of the chapter is locked
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at $19.99/month. Cancel anytime
Banner background image