Combining the scatter and area series

Highcharts also supports a scatter chart that enables us to plot the data trend from a large set of data samples. Here we are going to use the scatter series differently, which makes our chart a bit like a poster chart.

First, we are going to use a subset of the 'Ages 0 to 14' data and set the series to the scatter type:

              name: 'Ages 0 to 14',
              type: 'scatter',
              data: [ [ 1982, 23 ], [ 1989, 19 ], 
                      [ 2007, 14 ], [ 2004, 14 ], 
                      [ 1997, 15 ], [ 2002, 14 ], 
                      [ 2009, 13 ], [ 2010, 13 ] ]

Then, we will enable the data labels for the scatter series and make sure the marker shape is always 'circle', as follows:

          plotOptions: {
              scatter: {
                  marker: {
                      symbol: 'circle'
                  },
                  dataLabels: {
                      enabled: true
                  }
              }
          }

The preceding code snippet ...

Get Learning Highcharts 4 now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.