From: Dan Vanderkam Date: Thu, 30 Sep 2010 16:01:47 +0000 (-0400) Subject: displaying ticks again X-Git-Tag: v1.0.0~622^2~22 X-Git-Url: https://adrianiainlam.tk/git/?a=commitdiff_plain;h=67076b22e2685706c23f56bed8ee41a584c20b5b;p=dygraphs.git displaying ticks again --- diff --git a/dygraph-canvas.js b/dygraph-canvas.js index 7ce34bf..f22f858 100644 --- a/dygraph-canvas.js +++ b/dygraph-canvas.js @@ -132,12 +132,15 @@ DygraphLayout.prototype._evaluateLineTicks = function() { } this.yticks = new Array(); - for (var i = 0; i < this.options.yTicks.length; i++) { - var tick = this.options.yTicks[i]; - var label = tick.label; - var pos = 1.0 - (this.yscale * (tick.v - this.minyval)); - if ((pos >= 0.0) && (pos <= 1.0)) { - this.yticks.push([pos, label]); + for (var i = 0; i < 1; i++ ) { + var axis = this.options.yAxes[i]; + for (var j = 0; j < axis.ticks.length; j++) { + var tick = axis.ticks[j]; + var label = tick.label; + var pos = 1.0 - (axis.yscale * (tick.v - axis.minyval)); + if ((pos >= 0.0) && (pos <= 1.0)) { + this.yticks.push([pos, label]); + } } } }; diff --git a/dygraph.js b/dygraph.js index 7bcffd1..6a9f5b8 100644 --- a/dygraph.js +++ b/dygraph.js @@ -1697,6 +1697,7 @@ Dygraph.prototype.drawGraph_ = function(data) { var axes = out[0]; var seriesToAxisMap = out[1]; this.displayedYRange_ = axes[0].valueRange; + // TODO(danvk): remove yAxis, yTicks this.layout_.updateOptions( { yAxis: axes[0].valueRange, yTicks: axes[0].ticks, yAxes: axes,