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' }
}
);
});
我不明白你的問題?你需要什麼?該jsfiddle作爲您的形象? –
@ Nouphal.M如何在圖表外的jqplot中顯示標籤?這是我的問題。 –
喜歡你的第二個圖標? –