2012-05-29 151 views
8

jqPlot pieRenderer传奇广场我正在jqPlot出于某种原因,颜色编码的方块应该显示出来的馅饼渲染的传奇里面没有出现。我想知道它是否与我使用twitter bootstrap的事实有关?我没有使用任何其他的CSS库。没有显示

 var plot1 = jQuery.jqplot('chartdiv', [graphData], 
     { 
      grid: { 
       shadow: false, 
       background: '#FFFFFF',                       
      }, 
      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, 
        padding: 20, 
        startAngle: 270 
       } 
      }, 
      legend: { 
       show: true, 
       location: 'e', 
       fontSize: 11, 
       marginTop: 10,         
      } 
     }); 

回答

18

你确定正确装入jqPlotCSS(即URL/href是指向正确的位置)?

This is your code with jquery.jqplot.css loaded.

This is your code without the css.

This one is with both the jquery.jqplot.css and the bootstrap (downloaded without jQuery plugins and not linking the img folder that comes with the download).这里所有正确显示。因此你必须仔细检查jquery.jqplot.css的href

+1

万分感谢!就是这样。 –

+1

非常感谢!这样做了,我的图形看起来好多了! – Lukas

+1

工作就像一个魅力...... – Gowri