2014-01-30 92 views
3

Jqplot有一個像下面如何在jqplot中顯示餅圖外部的標籤?

enter image description here

jqplot Chart

我的問題是如何將jqplot chart像下面high chart外顯示標籤的圖表,

enter image description here

高圖表可在此處獲得fiddle

HIGHT圖表

<script src="http://code.highcharts.com/highcharts.js"></script> 
<script src="http://code.highcharts.com/modules/exporting.js"></script> 

如何實現與jqplot線圖表外顯示的標籤?

+0

我不明白你的問題?你需要什麼?該jsfiddle作爲您的形象? –

+0

@ Nouphal.M如何在圖表外的jqplot中顯示標籤?這是我的問題。 –

+0

喜歡你的第二個圖標? –

回答

2

dataLabelPositionFactor控制標籤在切片上的位置。增加將標籤滑向餡餅邊緣,減少將向標籤中心滑動。

dataLabelPositionFactor:1.2,

默認dataLabelThreshold值是3,因此值< = 3不顯示,因此使其向0

dataLabelThreshold:0

$(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 ('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, 
     //dataLabelPositionFactor controls position of label on slice. Increasing will slide label toward edge of pie, decreasing will slide label toward center of pie. 
     dataLabelPositionFactor : 1.2, 
     // default dataLabelThreshold value is 3, hence values <=3 are not displayed hence make it to 0 
     dataLabelThreshold : 0 
        } 
      }, 
      legend: { show:true, location: 'e' } 
    } 
  ); 
}); 
0

我使用以下方法將圖例放置在餅圖a之外第二它爲我工作

傳說:{顯示:真實,地點: 'NE',擺放位置: '外部'},

-1

我想你要找的是什麼this page.

時退房infoLabels子標題下的信息。

+2

請你詳細說明你的答案增加一些關於你提供的解決方案的更多描述? – abarisone