From: Dan Vanderkam Date: Mon, 31 Jan 2011 15:56:35 +0000 (-0500) Subject: 10 -> Dygraph.LOG_SCALE X-Git-Tag: v1.0.0~587^2~10 X-Git-Url: https://adrianiainlam.tk/git/?a=commitdiff_plain;h=5db0e2415efaf1b0ba3d94452ffbb5c6de3cdf80;p=dygraphs.git 10 -> Dygraph.LOG_SCALE --- diff --git a/dygraph.js b/dygraph.js index 661ebfb..160b344 100644 --- a/dygraph.js +++ b/dygraph.js @@ -966,7 +966,8 @@ Dygraph.movePan = function(event, g, context) { var maxValue = axis.initialTopValue + unitsDragged; var minValue = maxValue - axis.dragValueRange; if (axis.logscale) { - axis.valueWindow = [ Math.pow(10, minValue), Math.pow(10, maxValue) ]; + axis.valueWindow = [ Math.pow(Dygraph.LOG_SCALE, minValue), + Math.pow(Dygraph.LOG_SCALE, maxValue) ]; } else { axis.valueWindow = [ minValue, maxValue ]; } @@ -1924,6 +1925,7 @@ Dygraph.dateTicker = function(startDate, endDate, self) { // This is a list of human-friendly values at which to show tick marks on a log // scale. It is k * 10^n, where k=1..9 and n=-39..+39, so: // ..., 1, 2, 3, 4, 5, ..., 9, 10, 20, 30, ..., 90, 100, 200, 300, ... +// NOTE: this assumes that Dygraph.LOG_SCALE = 10. Dygraph.PREFERRED_LOG_TICK_VALUES = function() { var vals = []; for (var power = -39; power <= 39; power++) {