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

Introducing pie charts


Pie charts are a special kind of chart as they don't have x and y axes; rather, they are circular charts divided into slices where each slice represents a proportion of the actual data. They are most suitable for visualizing data that is meant to be shown proportionally or in percentages. The percentage of each category is usually shown next to the corresponding slice.

To gain more insight into a pie chart and its various configuration options that Highcharts provides, we are going to plot a pie chart representing the market share of desktop operating systems:

(function() {
  $( '#chart_container' ).highcharts({
    chart: {
      type: 'pie'
    },
    title: {
      text: 'Desktop Operating Systems Marketshare'
    },
    subtitle: {
      text: 'StatCounter'
    },
    tooltip: {
      valueSuffix: '%'
    },
    series: [{
      name: 'Operating Systems',
      data: [
        ['Windows', 88.19],
        ['MacOSX', 9.22],
        ['Linux', 1.58],
        ['Others...