Javascript examples for highcharts:Pie Chart
populate data for pie chart using json object
<html> <head> <title>Highcharts test tool</title> <meta name="viewport" content="width=device-width, initial-scale=1"> <script type="text/javascript" src="https://code.jquery.com/jquery-git.js"></script> <script type="text/javascript"> $(function(){// www.j a v a 2 s . c om var data = [{ "name": "Tokyo", "data": 3.0 }, { "name": "NewYork", "data": 2.0 }, { "name": "Berlin", "data": 3.5 }, { "name": "London", "data": 1.5 }]; // Highcharts requires the y option to be set $.each(data, function (i, point) { point.y = point.data; }); var chart = new Highcharts.Chart({ chart: { renderTo: 'container', type: 'pie' }, series: [{ data: data }] }); }); </script> </head> <body> <script src="https://code.highcharts.com/highcharts.js"></script> <div id="container" style="height: 300px"></div> </body> </html>