I am trying to pass the contents of an array to the jplot function but I am getting No data. The array has been json encoden in php and it is an associative array.
$.ajax({
type: "POST",
url: "actions/myphp.php",
data: PassArray,
dataType: 'json',
beforeSend: function (html) { // this happens before actual call
// alert(html);
},
success: function (html) { // this happens after we get results
// $("#loginoutcome").text(html);
// alert(html);
var obj =html ;
// Now the two will work
$.each(obj, function(key, value) {
alert(key + ' ' + value);
});
var s1 = obj;
var plot8 = $.jqplot('pie8', [s1], {
grid: {
drawBorder: false,
drawGridlines: false,
background: '#ffffff',
shadow: false
},
axesDefaults: {},
seriesDefaults: {
renderer: $.jqplot.PieRenderer,
rendererOptions: {
showDataLabels: true
}
},
legend: {
show: true,
rendererOptions: {
numberRows: 1
},
location: 's'
}
});
I have also tried to pass it using var s1 = [obj];
but that didn't work also ...