From c1bc242a0326dc48ee2de27321195090a3eb486a Mon Sep 17 00:00:00 2001 From: Dan Vanderkam Date: Mon, 31 Jan 2011 10:55:05 -0500 Subject: [PATCH] add comment to PREFERRED_LOG_TICK_VALUES --- dygraph.js | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/dygraph.js b/dygraph.js index 8f69337..661ebfb 100644 --- a/dygraph.js +++ b/dygraph.js @@ -1921,6 +1921,9 @@ 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, ... Dygraph.PREFERRED_LOG_TICK_VALUES = function() { var vals = []; for (var power = -39; power <= 39; power++) { @@ -1966,7 +1969,7 @@ Dygraph.binarySearch = function(val, arry, abs, low, high) { return mid; } } - return Dygraph.binarySearch(val, arry, abs, low, mid - 1); + return Dygraph.binarySearch(val, arry, abs, low, mid - 1); } if (element < val) { if (abs < 0) { @@ -2036,7 +2039,7 @@ Dygraph.numericTicks = function(minV, maxV, self, axis_props, vals) { domCoord : domCoord }; } else { - tick.label = ""; + tick.label = ""; } } ticks.push(tick); @@ -2045,6 +2048,7 @@ Dygraph.numericTicks = function(minV, maxV, self, axis_props, vals) { ticks.reverse(); } } + // ticks.length won't be 0 if the log scale function finds values to insert. if (ticks.length == 0) { // Basic idea: -- 2.7.4