簡體   English   中英

甜甜圈圖的jqPlot圖例不顯示色樣/框

[英]jqPlot legends for donut chart not displaying color-swatches/box

我有一個非常簡單的問題

代碼:

$(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' }      

  });
});

現在,圖例確實出現了,但是並沒有以這種方式出現。 在此處輸入圖片說明

沒有顏色,沒有盒子。 我究竟做錯了什么。 我照文件說的做了..有人嗎?

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

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

然后事情應該為您解決。

好吧,如果您已經包含了jqPLot CSS文件,那么我們將必須對其進行檢查並找出問題所在。

希望能幫助到你。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM