X-Git-Url: https://adrianiainlam.tk/git/?a=blobdiff_plain;f=dygraph.js;h=4fb7208f88495c08292cef3198cef3861fb655cb;hb=8e48eef771ca7e1f4091845e6c690ad309c46fd8;hp=a7fe70a2a3e93fdc8f1b64c33e77cce98e6e9d74;hpb=e3b6727e88b6d18f8162088d979c7c2d386a1237;p=dygraphs.git diff --git a/dygraph.js b/dygraph.js index a7fe70a..4fb7208 100644 --- a/dygraph.js +++ b/dygraph.js @@ -1700,40 +1700,6 @@ Dygraph.prototype.drawGraph_ = function(data) { this.layout_.updateOptions( { yAxis: axes[0].valueRange, yTicks: axes[0].ticks } ); - // Use some heuristics to come up with a good maxY value, unless it's been - // set explicitly by the user. - /* - var valueRange = this.attr_("valueRange"); - if (valueRange != null) { - this.addYTicks_(valueRange[0], valueRange[1]); - this.displayedYRange_ = valueRange; - } else { - // This affects the calculation of span, below. - if (this.attr_("includeZero") && minY > 0) { - minY = 0; - } - - // Add some padding and round up to an integer to be human-friendly. - var span = maxY - minY; - // special case: if we have no sense of scale, use +/-10% of the sole value. - if (span == 0) { span = maxY; } - var maxAxisY = maxY + 0.1 * span; - var minAxisY = minY - 0.1 * span; - - // Try to include zero and make it minAxisY (or maxAxisY) if it makes sense. - if (minAxisY < 0 && minY >= 0) minAxisY = 0; - if (maxAxisY > 0 && maxY <= 0) maxAxisY = 0; - - if (this.attr_("includeZero")) { - if (maxY < 0) maxAxisY = 0; - if (minY > 0) minAxisY = 0; - } - - this.addYTicks_(minAxisY, maxAxisY); - this.displayedYRange_ = [minAxisY, maxAxisY]; - } - */ - this.addXTicks_(); // Tell PlotKit to use this new data and render itself