2014-09-21 55 views
0

我有一個非常簡單的問題爲圓環圖jqPlot傳說不顯示顏色色板/盒

代碼:

$(document).ready(function(){ 
    var s1 = [['Status',600], ['Pictures',800], ['Starred',140], ['Comments',200]]; 
    //var s2 = [['a', 8], ['b', 12], ['c', 6], ['d', 9]]; 

    var plot3 = $.jqplot('chart3', [s1], { 
    seriesDefaults: { 
     // make this a donut chart. 
     renderer:$.jqplot.DonutRenderer, 
     rendererOptions:{ 
     // Donut's can be cut into slices like pies. 
     sliceMargin: 3, 
     // Pies and donuts can start at any arbitrary angle. 
     startAngle: -90, 
     showDataLabels: true, 
     // By default, data labels show the percentage of the donut/pie. 
     // You can show the data 'value' or data 'label' instead. 
     dataLabels: 'label' 
     } 
    }, 

    grid: { 
    drawGridLines: true,  // wether to draw lines across the grid or not. 
     // *Color of the grid lines. 
    background: 'white',  // CSS color spec for background color of grid. 
    borderColor: 'white',  // CSS color spec for border around grid. 
     shadow: false  
    } ,legend: { show:true, location: 'e' }  

    }); 
}); 

現在的傳說確實出現,但不是在某種程度上,它應該是出現像這樣.. enter image description here

沒有顏色,沒有框。我究竟做錯了什麼。我按照文件說過的..任何人?

+0

對我來說,它的工作檢查http://jsfiddle.net/devmgs/1xcn4bf5/你可以檢查控制檯,如果您的設置發生任何錯誤 – dev 2014-09-22 05:09:23

回答

0

當您忘記包含jqPlot CSS文件時會發生這種情況。

確保你已經包括<link rel="stylesheet" href="https://bitbucket.org/cleonello/jqplot/raw/b5a7796a9ebf/src/jquery.jqplot.css" type="text/css"/>

然後事情應該制定出適合您。

那麼,如果您已經包含jqPLot CSS文件,那麼我們將不得不檢查它,並發現問題。

希望它有幫助。