From 02c701b0571ad19c3680f73cf21beba80f2da8c3 Mon Sep 17 00:00:00 2001 From: David Schnur Date: Fri, 21 Dec 2012 16:05:02 -0500 Subject: [PATCH] Check dimensions on draw, not just on startup. Previously the container dimensions were checked only once, which prevented the pie from changing in size as its container was resized. --- jquery.flot.pie.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/jquery.flot.pie.js b/jquery.flot.pie.js index 8a04533..822fa9e 100644 --- a/jquery.flot.pie.js +++ b/jquery.flot.pie.js @@ -190,8 +190,6 @@ More detail and specific examples can be found in the included HTML file. canvas = plot.getCanvas(); target = $(canvas).parent(); options = plot.getOptions(); - canvasWidth = plot.getPlaceholder().width(); - canvasHeight = plot.getPlaceholder().height(); plot.setData(combine(plot.getData())); } } @@ -293,6 +291,9 @@ More detail and specific examples can be found in the included HTML file. return; // if no series were passed } + canvasWidth = plot.getPlaceholder().width(); + canvasHeight = plot.getPlaceholder().height(); + ctx = newCtx; setupPie();