From: etimberg Date: Fri, 1 Jan 2016 00:32:03 +0000 (-0500) Subject: Don't draw bars that represent data that is not valid (null, undefined, or NaN) X-Git-Tag: v2.0.0~85^2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=refs%2Fpull%2F1845%2Fhead;p=thirdparty%2FChart.js.git Don't draw bars that represent data that is not valid (null, undefined, or NaN) --- diff --git a/src/controllers/controller.bar.js b/src/controllers/controller.bar.js index 72e1fb9b7..696b67ad8 100644 --- a/src/controllers/controller.bar.js +++ b/src/controllers/controller.bar.js @@ -285,7 +285,10 @@ draw: function(ease) { var easingDecimal = ease || 1; helpers.each(this.getDataset().metaData, function(rectangle, index) { - rectangle.transition(easingDecimal).draw(); + var d = this.getDataset().data[index]; + if (d !== null && d !== undefined && !isNaN(d)) { + rectangle.transition(easingDecimal).draw(); + } }, this); },