O'Reilly logo

Highcharts Essentials by Bilal Shahid

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Adding series and points

We can dynamically add axes, series, and points to any chart after it has been initialized. In the following examples, we will first initialize a chart and then add points and series to it upon different actions.

Adding a point dynamically

Consider the following code for a chart representing energy consumption by leading continents in 2013:

(function() { $( '#energy_consumption' ).highcharts({ title: { text: 'Energy Consumption in 2013' }, xAxis: { type: 'category', title: { text: 'Continents' } }, yAxis: { title: { text: 'Million Metric Tons of Oil Equivalent' } }, series: [{ name: 'Energy Consumption', type: 'column', data: [{ id: 'north-america', name: 'North America', y: 2786.7 }, { id: 'asia', name: 'Asia', y: 5594 }] ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required