2013-12-12 39 views
0

我正在嘗試使用jQplot創建圖表。它運作良好,但我想有一個像http://www.jqplot.com/tests/pie-donut-charts.php的傳奇。但是我的傳奇並不像jqplot網站那樣工作。下面顯示的輸出圖片。有人注意到我想念的是什麼?在這裏,我附上代碼JQuery jqplot傳說不好顯示

$('#tes').live('pageshow', function() { 
     var data = [ 
['A', 12],['B', 9], ['C', 14], 
['D', 16],['E', 7]]; 
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, 
     dataLabels: 'value' 
    } 
    }, 
    legend: { show:true, location: 'e' } 
} 
); 
}); 

enter image description here

回答

0

我已經解決了問題。問題是因爲我沒有添加jquery.jqplot.css文件

0

您可能還沒有添加jquery.jqplot.css。 確保您已添加以下js和css:

<script type="text/javascript" src="jquery.min.js"></script> 
<script type="text/javascript" src="jquery.jqplot.min.js"></script> 
<script type="text/javascript" src="jqplot.donutRenderer.min.js"></script> 
<script type="text/javascript" src="jqplot.pieRenderer.min.js"></script> 


<link rel="stylesheet" href="jquery.jqplot.css" type="text/css" />