From: Joseph Rossi Date: Mon, 16 Nov 2015 19:06:46 +0000 (-0500) Subject: Bug: Allow points where canvas-y === 0 X-Git-Tag: v2.0.0~31^2~2 X-Git-Url: https://adrianiainlam.tk/git/?a=commitdiff_plain;h=b5794b6527e322cac2ad8f3e4cb1750a11361bd6;p=dygraphs.git Bug: Allow points where canvas-y === 0 The check for `utils.isOK` blacklists the value 0. In the context of validating selected points and reporting them in the legend, any point where canvas-y zero should be included. --- diff --git a/src/dygraph.js b/src/dygraph.js index bc75fef..a5e326d 100644 --- a/src/dygraph.js +++ b/src/dygraph.js @@ -1815,7 +1815,7 @@ Dygraph.prototype.updateSelection_ = function(opt_animFraction) { ctx.save(); for (i = 0; i < this.selPoints_.length; i++) { var pt = this.selPoints_[i]; - if (!utils.isOK(pt.canvasy)) continue; + if (isNaN(pt.canvasy) || pt.canvasy === null) continue; var circleSize = this.getNumericOption('highlightCircleSize', pt.name); var callback = this.getFunctionOption("drawHighlightPointCallback", pt.name); diff --git a/src/plugins/legend.js b/src/plugins/legend.js index c0ab35a..ab22fbb 100644 --- a/src/plugins/legend.js +++ b/src/plugins/legend.js @@ -268,7 +268,7 @@ Legend.generateLegendHTML = function(g, x, sel_points, oneEmWidth, row) { var seriesData = labelToSeries[pt.name]; seriesData.y = pt.yval; - if ((pt.yval === 0 && !showZeros) || !utils.isOK(pt.canvasy)) { + if ((pt.yval === 0 && !showZeros) || isNaN(pt.canvasy) || pt.canvasy === null) { seriesData.isVisible = false; continue; }