Найдите код ниже.Это отображает диаграмму столбца для данных, присутствующих в JSON.
<html>
<head>
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.6.1/jquery.min.js" type="text/javascript"></script>
<script src="http://code.highcharts.com/highcharts.js" type="text/javascript"></script>
<script type="text/javascript">
jQuery(document).ready(function(){
var data=[{"date": "2012-02-23", "number": 2}, {"date": "2012-02-21", "number": 4}];
var chart = new Highcharts.Chart(
{
chart:{
renderTo: "container", // the div id where you want to dispaly the chart
type: 'column', // type of chart as colum chart, it can be anything-'bar','pie','column' etc.
height: 300
},
title: {
text: "Numbers on two different dates"
},
xAxis: {
categories: [data[0]["date"],data[1]["date"]]
},
yAxis: {
title: {
text: 'Numbers on date'
}
},
series: [{name:"numbers",data:[data[0]["number"],data[1]["number"]]}]
}
);
});
</script>
</head>
<body>
<div id="container">
</div>
</body>
</html>