From d09b2786012251ed854f65a356fa8ba6ddd8a96e Mon Sep 17 00:00:00 2001 From: David Schnur Date: Fri, 21 Dec 2012 16:07:15 -0500 Subject: [PATCH] Allow the pie to redraw on resize or update. When a pie's labels don't fit within its container, the pie is redrawn with a smaller radius until the labels fit, or a fixed number of retry attempts are exhausted. The redraw flag was not reset on success, however, which prevented the pie from being redrawn again after a resize or update. --- jquery.flot.pie.js | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/jquery.flot.pie.js b/jquery.flot.pie.js index 822fa9e..b48df0b 100644 --- a/jquery.flot.pie.js +++ b/jquery.flot.pie.js @@ -318,6 +318,12 @@ More detail and specific examples can be found in the included HTML file. target.prepend("
Could not draw pie with labels contained inside canvas
"); } + // Reset the redraw flag on success, so the loop above can run + // again in the event of a resize or other update. + // TODO: We should remove this redraw system entirely! + + redraw = true; + if (plot.setSeries && plot.insertLegend) { plot.setSeries(slices); plot.insertLegend();