1
嗨我是PHP编程新手,我的饼图出现错误。它不会分成不同的切片,只显示1片显示100%。PHP饼图不会分裂成片
这是我的饼图代码:
<?php // for piechart ?>
<script>
$(document).ready(function() {
var data = [
[ 'Close to Signoff',
<?php echo $project_status[5]; ?>],['Complete', <?php echo $project_status[4]; ?>], ['In Progress', <?php echo $project_status[3]; ?>],
['Overdue', <?php echo $project_status[2]; ?>],['Pending', <?php echo $project_status[1]; ?>]
];
var plot1 = jQuery.jqplot ('chart1', [data],
{
seriesDefaults: {
// Make this a pie chart.
renderer: jQuery.jqplot.PieRenderer,
rendererOptions: {
// Put data labels on the pie slices.
// By default, labels show the percentage of the slice.
showDataLabels: true
}
},
legend: { show:true, location: 'e' }
}
);
});
</script>
难道我做错了什么?
你会得到哪个错误? –
1)检查源代码,如果'var data = [']具有合适的值 2)检查是否包含所有脚本插件(jqplot.pieRenderer.min.js) –