Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- $(document).ready(function() {
- Highcharts.setOptions({
- global: {
- useUTC: false
- }
- });
- options = {
- chart: {
- renderTo: 'container',
- type: 'spline',
- },
- xAxis: {
- type: 'datetime',
- dateTimeLabelFormats: {
- day: '%e of %b',
- hour: '%H:%M<br>%d %b'
- }
- }
- $.getJSON(url, function(json) {
- $.each(json, function(key,value) {
- var series = { data: []};
- $.each(value, function(key,val) {
- if (key == 'name') {
- series.name = val;
- } else {
- $.each(val, function(key, val) {
- var d = val.split(",");
- series.data.push([d[0],d[1]]); });
- }
- });
- options.series.push(series);
- });
- var options1 = $.extend(json, options);
- chart = new Highcharts.Chart(options1);
- });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement