我正在使用 jqplot 制作饼图,我使用了 jqplot 文档中给出的示例代码,但我遇到了一些错误,例如e.jqplot 未定义,我的代码如下:
<script src="js/jquery.js"></script>
<script type="text/javascript" src="js/piechart/jqplot.pieRenderer.min.js"></script>
<script type="text/javascript" src="js/piechart/jqplot.donutRenderer.min.js"></script>
<script>
$(document).ready(function(){
var data = [
['Heavy Industry', 12],['Retail', 9], ['Light Industry', 14],
['Out of home', 16],['Commuting', 7], ['Orientation', 9]
];
var plot1 = jQuery.jqplot ('weeklyProjectSummary', [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>
<div id="weeklyProjectSummary"></div>
有人可以建议我创建饼图的正确方法吗?谢谢!