Highcharts Demo

author(s): Torstein Hønsi

HTML

<!--<script src="http://code.highcharts.com/highcharts.js"></script>-->
<script src="http://code.highcharts.com/stock/highstock.js"></script>
<div id="container" style="min-width: 400px; height: 400px; margin: 0 auto"></div>

JavaScript

$(function () {
    
				     ds = JSON.stringify([
				       {
				          "date":1367902800000,
				          "a":789118,
				          "b":49475,
				          "c":739643
				       },
				       {
				          "date":1367989200000,
				          "a":5759546,
				          "b":286657,
				          "c":5472889
				       },
				       {
				          "date":1368075600000,
				          "a":5827559,
				          "b":283024,
				          "c":5544535
				       }
				     ]);
					obj = JSON.parse(ds);
					var count = Object.keys(obj).length;
					count = parseInt(count, 10);
						 $('#container').highcharts({
					            title: {
					                text: '',
					            },
					   			credits: {
					   				enabled: false
					   			},
					            xAxis: {
					            	labels: {
					 					formatter: function () {
					 						return Highcharts.dateFormat('%m/%d', this.value);
					 					}
					 				},
					 				tickPixelInterval: 200
					            },
					            yAxis: {
					            	min: 0,
					                title: {
					                    text: ''
					                },
					            },
					            tooltip: {
					                enabled: true,
					                formatter: function() {
			                            return Highcharts.dateFormat('%A, %b %e, %Y', this.x) + 
			                            '<br/>'+ this.series.name +': <b>' + Highcharts.numberFormat(this.point.y,0) + '</b>';
			                              }
					            },
					            legend: {
					                layout: 'vertical',
					                align: 'right',
					                verticalAlign: 'middle',
					                borderWidth: 0
					            },
					            series: [{
					                name: 'A',
					                data : (function() {
												var data = [], i;
												for(i = 0; i < count; i++) {
													data.push([
														parseInt(obj[i].date,...