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

Converting other chart types to the polar chart


Various chart types, including column, bar, line, spline, and area charts, can be converted into a polar chart by simply including Highcharts-4.x.x/js/highcharts-more.js in the page and then setting the polar property on the chart to true.

Consider the first example in the Introducing column charts section from Chapter 2, Column and Bar Charts, in which we visualized the Olympics medal table using a column chart. The inclusion of highcharts-more.js to the page and the following modification will convert it into a polar chart:

$( '#medal_table' ).highcharts({
  chart: {
    polar: true
  },
  title: {
    text: 'Olympics 2012 Medal Table'
  },
  xAxis: {
    title: {
      text: 'Countries'
    },
    categories: ['United States', 'China', 'Russian Federation', 'Great Britain', 'South Korea']
  },
  series: [{
    name: 'Medals',
    data: [104, 88, 82, 65, 28],
    type: 'column'
  }]
});

The result is as follows: