diff --git a/jquery.flot.pie.js b/jquery.flot.pie.js index 6553c8e..a4b538a 100644 --- a/jquery.flot.pie.js +++ b/jquery.flot.pie.js @@ -293,16 +293,15 @@ More detail and specific examples can be found in the included HTML file. } else { centerLeft -= legendWidth / 2; } + if (centerLeft < maxRadius) { + centerLeft = maxRadius; + } else if (centerLeft > canvasWidth - maxRadius) { + centerLeft = canvasWidth - maxRadius; + } } else { centerLeft += options.series.pie.offset.left; } - if (centerLeft < maxRadius) { - centerLeft = maxRadius; - } else if (centerLeft > canvasWidth - maxRadius) { - centerLeft = canvasWidth - maxRadius; - } - var slices = plot.getData(), attempts = 0;