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:
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:...