2014-01-30 93 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