From 2d2ca32a5ca6d34004a0a5f42ff54cce15b58f36 Mon Sep 17 00:00:00 2001 From: Ole Laursen Date: Mon, 4 Apr 2011 13:01:33 +0200 Subject: [PATCH] Fix problem with null values and pie plugin (patch by gcruxifix) --- NEWS.txt | 10 ++++++++++ jquery.flot.pie.js | 5 +++-- 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/NEWS.txt b/NEWS.txt index 5f8e1a0..8e74d49 100644 --- a/NEWS.txt +++ b/NEWS.txt @@ -1,3 +1,13 @@ +Flot x.x +-------- + + +Bug fixes + +- Fix problem with null values and pie plugin (patch by gcruxifix, + issue 500). + + Flot 0.7 -------- diff --git a/jquery.flot.pie.js b/jquery.flot.pie.js index 70941dd..55e8013 100644 --- a/jquery.flot.pie.js +++ b/jquery.flot.pie.js @@ -391,7 +391,7 @@ More detail and specific examples can be found in the included HTML file. function drawSlice(angle, color, fill) { - if (angle<=0) + if (angle <= 0 || isNaN(angle)) return; if (fill) @@ -682,7 +682,8 @@ More detail and specific examples can be found in the included HTML file. function drawHighlight(series) { - if (series.angle < 0) return; + if (series.angle <= 0 || isNaN(angle)) + return; //octx.fillStyle = parseColor(options.series.pie.highlight.color).scale(null, null, null, options.series.pie.highlight.opacity).toString(); octx.fillStyle = "rgba(255, 255, 255, "+options.series.pie.highlight.opacity+")"; // this is temporary until we have access to parseColor