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 spline charts


Spline charts are similar to line charts; the only difference is that in line charts, the data points are connected by a straight line whereas in spline charts, the points are connected by curves. A line chart can easily be converted into a spline chart by changing the chart type from line to spline.

Consider the following example showing Producer Price Index (PPI) in the US from 2007 to 2012:

(function() {
  $( '#chart_container' ).highcharts({
    chart: {
      type: 'spline'
    },

    title: {
      text: 'Producer Price Index (PPI) in the US'
    },
    subtitle: {
      text: 'Source: Bureau of Labor Statistics'
    },
    xAxis: {
      type: 'datetime'
    },
    series: [{
      name: 'PPI',
      data: [
        [Date.UTC(2007, 00, 01), 172.6],
        [Date.UTC(2008, 00, 01), 189.6],
        [Date.UTC(2009, 00, 01), 172.9],
        [Date.UTC(2010, 00, 01), 184.7],
        [Date.UTC(2011, 00, 01), 201],
        [Date.UTC(2012, 00, 01), 202.2]
      ]
   ...