Ensure that pie's legendWidth remains numeric.

Substitute zero when .width() returns undefined, since legendWidth is
used in numeric calculations that break when it is undefined.  This
became a problem with the release of jQuery 1.8.0, which returns
undefined instead of null when an element doesn't exist.  This was fixed
in 1.8.1, but this is good practice anyway.
pull/1/head
David Schnur 14 years ago
parent 4e38170f2a
commit 5951dcb03c

@ -191,7 +191,7 @@ More detail and specific examples can be found in the included HTML file.
function setupPie()
{
legendWidth = target.children().filter('.legend').children().width();
legendWidth = target.children().filter('.legend').children().width() || 0;
// calculate maximum radius and center point
maxRadius = Math.min(canvasWidth,(canvasHeight/options.series.pie.tilt))/2;

Loading…
Cancel
Save