</tr>
<tr>
++<<<<<<< HEAD
+ <td><strong>noZoomFlagChange</strong></td>
+ <td><code></code></td>
+ <td><code></code></td>
+ <td>
+ When this flag is passed along with either the <code>dateWindow</code> or <code>valueRange</code> 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 <code>isZoomed</code> method to determine this.
+ <div class="tests">Tests: <a href="tests/no-zoom-change.html">no-zoom-change</a></div>
++=======
+ <td><strong>logscale</strong></td>
+ <td><code>boolean</code></td>
+ <td><code>false</code></td>
+ <td>
+ 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.</p>
+
+ Not compatible with showZero, and ignores connectSeparatedPoints. Also, showing log scale
+ with valueRanges that are less than zero will result in an unviewable graph.<br/>
+
+ <div class="tests">Tests: <a href="tests/logscale.html">logscale</a>,
+ <a href="tests/stock.html"> stock</div>
++>>>>>>> a6a505d1759f087a1e29ad84fc8510aa4cbc4f6e
</td>
</tr>
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' &&
// 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();
* indices are into the axes_ array.
*/
Dygraph.prototype.computeYAxes_ = function() {
- this.axes_ = [{ yAxisId: 0 }]; // always have at least one y-axis.
+ 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, g : this }]; // always have at least one y-axis.
this.seriesToAxisMap_ = {};
// Get a list of series names.