jqPlot does not show graph
Hi, I'm having trouble with jqPlot which is not showing the graph as expected.
http://sinope.c0demonkey.com/~halfdan/stats/
Basically I request some JSON data from my Server using jQuery Ajax:
- function updateGraph() {
$.ajax({
type: "GET",
url: "<?php echo $_SERVER["SCRIPT_NAME"]; ?>",
data: 'vhost=' + $('#vhost').val()
+ '&period=' + $("#period").val()
+ '&scale=' + $('#scale').val()
+ '&format=json',
dataType: "json",
success: function(data) {
drawGraph(data);
}
});
}
The JSON string that is returned has the format: [['1. May 2010', 0.45], ['2. May 2010', 0.69], ...]
- function drawGraph(data) {
$('#graph').html("");
$.jqplot(
'graph',
[data],
{
title: $('#period :selected').text() + " Traffic for " + $('#vhost :selected').text(),
legend: {
show: true,
location: 'nw'
},
series:[{renderer:$.jqplot.BarRenderer}],
axesDefaults: {
tickRenderer: $.jqplot.CanvasAxisTickRenderer,
tickOptions: {
angle: -30,
fontSize: '10pt'
}
},
axes: {
xaxis: {
label: 'Date',
renderer: $.jqplot.CategoryAxisRenderer,
},
yaxis: {
label: 'Traffic in ' + $('#scale :selected').text(),
autoscale:true
}
}
}
);
This function should show the graph. What appears is an empty graph, with proper title, axis naming and scaling (!) but no data shows up. FireBug does not report any JS errors.
Any ideas?