Javascript examples for highcharts:Chart Series
Create series separately
<html> <head> <meta name="viewport" content="width=device-width, initial-scale=1"> <script type="text/javascript" src="https://code.jquery.com/jquery-1.8.3.js"></script> <script type="text/javascript" src="https://code.highcharts.com/highcharts.js"></script> <script type="text/javascript"> var chart; // globally available $(document).ready(function() { var items = [{//from w w w . j av a 2s . com "name": "Male", "data": [10, 34, 30] }, { "name": "Female", "data": [20, 22, 15] }]; var options = { chart: { renderTo: 'container', type: 'bar' }, xAxis: { categories: ['Age 20-24', 'Age 25-30', 'Age 30-40'], title: { text: null } }, series: items }; //Create the chart chart = new Highcharts.Chart(options); }); </script> </head> <body> <div id="container"></div> </body> </html>