我正在使用flot库绘制饼图。我想绘制具有图例和饼图标签组合的饼图。其中饼图标签将仅显示切片百分比,而数据系列中的相应标签信息将显示在图例中。使用浮点图可以实现这种组合吗?
如果要仅包含百分比(无标签)的切片,则需要formatter
为标签选项定义一个自定义:
$.plot($("#placeholder"), datapie, {
series: {
pie: {
show: true,
label: {
show: true,
// Added custom formatter here...
formatter: function(label,point){
return(point.percent.toFixed(2) + '%');
}
}
}
},
legend: {show: true}
});
在这里摆弄。
本文收集自互联网,转载请注明来源。
如有侵权,请联系[email protected] 删除。
我来说两句