Advertisement
Guest User

Untitled

a guest
Mar 11th, 2013
425
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. $(document).ready(function() {
  2.         Highcharts.setOptions({
  3.         global: {
  4.                 useUTC: false
  5.         }
  6.         });
  7.         options = {
  8.                 chart: {
  9.                         renderTo: 'container',
  10.                         type: 'spline',
  11.           },
  12.                 xAxis: {
  13.                         type: 'datetime',
  14.                 dateTimeLabelFormats: {
  15.                                 day: '%e of %b',
  16.                                 hour: '%H:%M<br>%d %b'
  17.                         }
  18.                 }
  19.  
  20. $.getJSON(url, function(json) {
  21.             $.each(json, function(key,value) {
  22.                 var series = { data: []};
  23.                 $.each(value, function(key,val) {
  24.                     if (key == 'name') {
  25.                         series.name = val;
  26.                     } else {
  27.                     $.each(val, function(key, val) {
  28.                         var d = val.split(",");
  29.                         series.data.push([d[0],d[1]]);                      });
  30.                     }
  31.                 });
  32.                 options.series.push(series);
  33.             });
  34.                         var options1 = $.extend(json, options);
  35.                         chart = new Highcharts.Chart(options1);
  36.                 });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement