teletrade58
New Member
I am trying to use javascript Highcharts to display a chart of rankings from JSON data. I can't seem to get the chart to display.This is the javascript code:\[code\]$(document).ready(function() {var options = { chart: { renderTo: 'drawing', zoomType: 'x', width: 900, height: 222 }, exporting: { enabled:true }, title: { text: url+' - '+keyword }, credits: { text: '****', href: 'http://***/' }, xAxis: { type: 'datetime', dateTimeLabelFormats: { day: '%b %e ' } }, yAxis: [{ //min: 1, allowDecimals: false, reversed: true, ///: .2, //maxPadding: .2, title: { text: 'Rankings' } },], tooltip: { crosshairs: true, shared: true }, series: [{}]}; var url = "http://*******/chart.php"; $.getJSON(url, function(data) { $.each(data, function(arrayID,group) { $.each(group.data, function(id,val) { arg = val[0].replace(/Date.UTC\((.*?)\)/, '$1').split(','); var timestamp = Date.UTC.apply( null , arg ); date=new Date(timestamp); data[arrayID].data[id][0] = timestamp; }); }); options.series[0].data = http://stackoverflow.com/questions/15835306/data; var chart = new Highcharts.Chart(options); }); });\[/code\]Our PHP Script gives us this JSON:\[code\][{"name":"Google Rank","data":[["Date.UTC(2013,04,05)","23"],["Date.UTC(2013,04,04)","23"],["Date.UTC(2013,04,03)","22"],["Date.UTC(2013,04,02)","24"],["Date.UTC(2013,04,01)","26"],["Date.UTC(2013,03,31)","24"],["Date.UTC(2013,03,30)","24"],["Date.UTC(2013,03,29)","25"],["Date.UTC(2013,03,28)","25"],["Date.UTC(2013,03,27)","25"],["Date.UTC(2013,03,26)","26"],["Date.UTC(2013,03,25)","25"],["Date.UTC(2013,03,24)","24"],["Date.UTC(2013,03,23)","-"],["Date.UTC(2013,03,22)","10"],["Date.UTC(2013,03,21)","10"],["Date.UTC(2013,03,20)","10"],["Date.UTC(2013,03,19)","10"],["Date.UTC(2013,03,18)","10"],["Date.UTC(2013,03,17)","10"],["Date.UTC(2013,03,16)","9"],["Date.UTC(2013,03,15)","9"],["Date.UTC(2013,03,14)","9"],["Date.UTC(2013,03,13)","9"],["Date.UTC(2013,03,12)","9"]],"visible":"true","pointInterval":"86400000","showInLegend":"false"},{"name":"Bing Rank","data":["Date.UTC(2013,2,9)",9],"visible":"true","pointInterval":"86400000","showInLegend":"false"}]\[/code\]The Highcharts is not displaying the chart. The \[code\]Date.UTC(2013,03,12)\[/code\] is suppose to go on the X-Axis & the number next to it is suppose to be the rank number. Can anyone see what is wrong?