我能够开始渲染时间图的数据集,所以我认为图形问题不会更具挑战性,但由于某种原因,我在正确输出它时遇到了真正的麻烦。
json数据:
[{"data":[
{"label":"Times Appeared In Backpacks","data":45,"color":"#D9868C"},
{"label":" All Backpacks","data":10919,"color":"#86b5d9"}]
]}
由...制作
$json_data[] = array('label' => "Times Appeared In Backpacks", 'data' => $appeared, 'color'=> "#D9868C");
$json_data[] = array('label' =>" All Backpacks", 'data' => $total, 'color' => "#86b5d9");
$mergedData[] = array('data' => $json_data);
echo json_encode($mergedData);
被称为
$.ajax({
url: "/whats/encode_pie_graph.php",
method: 'GET',
dataType: 'json',
success: onOutboundReceivedPie
});
function onOutboundReceivedPie(data) {
console.log(data);
$.plot($(".graph_pie"), data, {
series: {
pie: {
show: true
}
},
legend: {
show: false
}
});
}
此刻没有任何输出。
这里有什么明显不正确的地方吗?
谢谢。