PR Comment: Removing checks for undefined and null. They aren't possible
authorJoseph Rossi <jrossi@optirtc.com>
Mon, 16 Nov 2015 21:00:41 +0000 (16:00 -0500)
committerJoseph Rossi <jrossi@optirtc.com>
Mon, 16 Nov 2015 21:00:41 +0000 (16:00 -0500)
src/dygraph.js
src/plugins/legend.js

index ee39383..41e5cc1 100644 (file)
@@ -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 (isNaN(pt.canvasy) || pt.canvasy === null || pt.canvasy === undefined) continue;
+      if (isNaN(pt.canvasy)) continue;
 
       var circleSize = this.getNumericOption('highlightCircleSize', pt.name);
       var callback = this.getFunctionOption("drawHighlightPointCallback", pt.name);
index 9644576..96e68f4 100644 (file)
@@ -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) || isNaN(pt.canvasy) || pt.canvasy === null || pt.canvasy === undefined) {
+      if ((pt.yval === 0 && !showZeros) || isNaN(pt.canvasy)) {
         seriesData.isVisible = false;
         continue;
       }