Book Image

Learning Highcharts 4

By : Joe Kuan
Book Image

Learning Highcharts 4

By: Joe Kuan

Overview of this book

Table of Contents (23 chapters)
Learning Highcharts 4
Credits
About the Author
Acknowledgments
About the Reviewers
www.PacktPub.com
Preface
Index

Introducing line charts


First let's start with a single-series line chart. We will use one of the many data sets provided by The World Bank organization at www.worldbank.org. The following is the code snippet to create a simple line chart that shows the percentage of population aged 65 and above in Japan for the past three decades:

        var chart = new Highcharts.Chart({
            chart: {
                renderTo: 'container'
            },
            title: {
                text: 'Population ages 65 and over (% of total)'
            },
            credits: { 
                         position: {
                         align: 'left',
                         x: 20
                     },
                     text: 'Data from The World Bank'
            },
            yAxis: {
                       title: {
                       text: 'Percentage %'
                   }
            },
            xAxis: {
                categories: ['1980', '1981', '1982', ... ],
           ...