I use jquery flot for my pie charts and I have a problem with overlapping
labels when the pie chart pieces are very small. Is there a good
solution for that?
My pie chart:
series: {
pie: {
show: true,
radius: 1,
label: {
show: true,
radius: 5/8,
formatter: function(label, series){
return '<div style="font-size:12pt;text- align:center;padding:2px;color:black;margin-left:-80%;margin- top:-20%;">'+label+'<br/>'+Math.round(series.percent)+'%</div>';
},
background: { opacity: 0.5 }
}
}
},
legend: {
show: false
}
Thanks, Arshavski Alexander.
A solution from Flot’s Google code issues by Marshall Leggett(link):
long story short:
In jquery.flot.pie.js and after the line 463 that contains:
label.css('left', labelLeft);add the following code:
Add the following to
drawLabels()and you are done:var labels = [];