[英]Label the JQplot pie chart
I am using JQplot Pie Chart. 我正在使用JQplot饼图。 I need the labels to appear outside the chart.
我需要标签出现在图表之外。 How can I make that possible?
我怎么能做到这一点?
If you mean data labels then you need to set the dataLabelPositionFactor
to appropriate value greater than 1.0
and you are done. 如果您的意思是数据标签,那么您需要将
dataLabelPositionFactor
设置为大于1.0
适当值,并且您已完成。
To do that yuo need to specify the placement propertie : 要做到这一点,你需要指定放置属性:
legend: {
show:true; placement: "outsideGrid"
}
Example : 示例:
$.jqplot('YOUR_DIV_ID', [['LABEL_1',2],['LABEL_2',232],['LABEL_3',22], {
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
}
},
//Make legend visibile, outside the chart
legend: {
show:true, placement: "outsideGrid"
}
}
);
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.