From: Neal Nelson Date: Thu, 10 Feb 2011 10:22:22 +0000 (+0100) Subject: Merge branch 'master' of http://github.com/danvk/dygraphs X-Git-Tag: v1.0.0~536^2~1^2~4 X-Git-Url: https://adrianiainlam.tk/git/?a=commitdiff_plain;h=995b9973b84f282f4c54426e888834617c3cc1f4;p=dygraphs.git Merge branch 'master' of github.com/danvk/dygraphs Conflicts: docs/index.html dygraph.js --- 995b9973b84f282f4c54426e888834617c3cc1f4 diff --cc docs/index.html index 400478b,8693bc9..e06f7e9 --- a/docs/index.html +++ b/docs/index.html @@@ -1026,13 -948,18 +1027,28 @@@ perl -ne 'BEGIN{print "Month,Nominal,Re ++<<<<<<< HEAD + noZoomFlagChange + + + + When this flag is passed along with either the dateWindow or valueRange options, the zoom flags are not changed to reflect a zoomed state. + This is primarily useful for when the display area of a chart is changed programmatically and also where manual zooming is allowed and use is made of the isZoomed method to determine this. +
Tests: no-zoom-change
++======= + logscale + boolean + false + + When set for a y-axis, the graph shows that axis in y-scale. Any values less than or equal + to zero are not displayed.

+ + Not compatible with showZero, and ignores connectSeparatedPoints. Also, showing log scale + with valueRanges that are less than zero will result in an unviewable graph.
+ +
Tests: logscale, + stock
++>>>>>>> a6a505d1759f087a1e29ad84fc8510aa4cbc4f6e diff --cc dygraph.js index 646159a,4a1cef2..b043d06 --- a/dygraph.js +++ b/dygraph.js @@@ -261,14 -260,12 +264,20 @@@ Dygraph.prototype.__init__ = function(d this.start_(); }; - // axis is an optional parameter. Can be set to 'x' or 'y'. ++// Axis is an optional parameter. Can be set to 'x' or 'y'. +Dygraph.prototype.isZoomed = function(axis) { + if (axis == null) return this.zoomed_x_ || this.zoomed_y_; + if (axis == 'x') return this.zoomed_x_; + if (axis == 'y') return this.zoomed_y_; + throw "axis parameter to Dygraph.isZoomed must be missing, 'x' or 'y'."; +}; + + Dygraph.prototype.toString = function() { + var maindiv = this.maindiv_; + var id = (maindiv && maindiv.id) ? maindiv.id : maindiv + return "[Dygraph " + id + "]"; + } + Dygraph.prototype.attr_ = function(name, seriesName) { if (seriesName && typeof(this.user_attrs_[seriesName]) != 'undefined' && @@@ -1226,13 -1345,12 +1358,13 @@@ Dygraph.prototype.doZoomY_ = function(l // coordinates increase as you go up the screen. var valueRanges = []; for (var i = 0; i < this.axes_.length; i++) { - var hi = this.toDataCoords(null, lowY, i); - var low = this.toDataCoords(null, highY, i); - this.axes_[i].valueWindow = [low[1], hi[1]]; - valueRanges.push([low[1], hi[1]]); + var hi = this.toDataYCoord(lowY, i); + var low = this.toDataYCoord(highY, i); + this.axes_[i].valueWindow = [low, hi]; + valueRanges.push([low, hi]); } + this.zoomed_y_ = true; this.drawGraph_(); if (this.attr_("zoomCallback")) { var xRange = this.xAxisRange(); @@@ -2138,16 -2370,7 +2391,16 @@@ Dygraph.prototype.drawGraph_ = function * indices are into the axes_ array. */ Dygraph.prototype.computeYAxes_ = function() { + var valueWindows; + if (this.axes_ != undefined) { + // Preserve valueWindow settings. + valueWindows = []; + for (var index = 0; index < this.axes_.length; index++) { + valueWindows.push(this.axes_[index].valueWindow); + } + } + - this.axes_ = [{ yAxisId: 0 }]; // always have at least one y-axis. + this.axes_ = [{ yAxisId : 0, g : this }]; // always have at least one y-axis. this.seriesToAxisMap_ = {}; // Get a list of series names.