From: Dan Vanderkam Date: Fri, 13 May 2011 00:52:03 +0000 (-0400) Subject: fix issue 193 -- need to consider area.y when computing data coords X-Git-Tag: v1.0.0~480 X-Git-Url: https://adrianiainlam.tk/git/?a=commitdiff_plain;h=d9816e62fc86aab46798e33445f2c5b863b48f9d;p=dygraphs.git fix issue 193 -- need to consider area.y when computing data coords --- diff --git a/dygraph.js b/dygraph.js index 2e8a38e..a976436 100644 --- a/dygraph.js +++ b/dygraph.js @@ -556,7 +556,7 @@ Dygraph.prototype.toDataYCoord = function(y, axis) { if (typeof(axis) == "undefined") axis = 0; if (!this.axes_[axis].logscale) { - return yRange[0] + (area.h - y) / area.h * (yRange[1] - yRange[0]); + return yRange[0] + (area.y + area.h - y) / area.h * (yRange[1] - yRange[0]); } else { // Computing the inverse of toDomCoord. var pct = (y - area.y) / area.h