Book Image

Highcharts Essentials

By : Bilal Shahid
Book Image

Highcharts Essentials

By: Bilal Shahid

Overview of this book

Table of Contents (16 chapters)
Highcharts Essentials
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
Index

Creating bubble charts


The difference between bubble charts and all the other chart types we have been through is that a bubble chart uses three dimensional data to plot its data point. Hence, instead of providing values for just the x and y axes, we also provide the z axis value as the third variable. Thus, bubble charts can be used for visualizing 3D data where three variables are correlated.

Note

For the following code to work, you need to include Highcharts-4.x.x/js/highcharts-more.js in your page.

Consider the following example in which we plot a bubble chart to show the correlation between life expectancy, fertility rate, and population of selected countries of the world:

$( '#chart_container' ).highcharts({
  chart: {
    type: 'bubble'
  },
  title: {
    text: 'Life Expectancy, Fertility Rate and Population'
  },
  xAxis: {
    title: {
      text: 'Life Expectancy'
    }
  },
  yAxis: {
    title: {
      text: 'Fertility Rate'
    }
  },
  tooltip: {
    headerFormat: '<b>{point...