From: steve Date: Tue, 7 Sep 2010 15:56:14 +0000 (-0600) Subject: Added labelsShowZeroValues option. When this option is set to false the labelsDiv... X-Git-Tag: v1.0.0~664^2~3 X-Git-Url: https://adrianiainlam.tk/git/?a=commitdiff_plain;h=bcd3ebf04c7eeb257afb0f6055d28cfd85a79e1b;p=dygraphs.git Added labelsShowZeroValues option. When this option is set to false the labelsDiv will not contain any points that have a 0 value. --- diff --git a/dygraph.js b/dygraph.js index 5e04d1d..746949d 100644 --- a/dygraph.js +++ b/dygraph.js @@ -90,6 +90,7 @@ Dygraph.DEFAULT_ATTRS = { // TODO(danvk): move defaults from createStatusMessage_ here. }, labelsSeparateLines: false, + labelsShowZeroValues: true, labelsKMB: false, labelsKMG2: false, showLabelsOnHighlight: true, @@ -983,6 +984,7 @@ Dygraph.prototype.updateSelection_ = function() { if (this.attr_('showLabelsOnHighlight')) { // Set the status message to indicate the selected point(s) for (var i = 0; i < this.selPoints_.length; i++) { + if (!this.attr_("labelsShowZeroValues") && this.selPoints_[i].yval == 0) continue; if (!isOK(this.selPoints_[i].canvasy)) continue; if (this.attr_("labelsSeparateLines")) { replace += "
";