X-Git-Url: https://adrianiainlam.tk/git/?a=blobdiff_plain;f=dygraph.js;h=e19acada735a2b57a28eee05ebe4a37c7ffa717e;hb=7bba83d8116f0712e57ee4bf57e40ef3c749f3ff;hp=0390a6f5b1f280c933ae55fc04d10ae7b26b402f;hpb=6e6a2b0a85d2d34deb4fcecc2b8a32f6eb91a964;p=dygraphs.git diff --git a/dygraph.js b/dygraph.js index 0390a6f..e19acad 100644 --- a/dygraph.js +++ b/dygraph.js @@ -1948,11 +1948,14 @@ Dygraph.numericTicks = function(minV, maxV, self, axis_props, vals) { // NOTE(konigsberg): Dan, should self.height_ be self.plotter_.area.h? var nTicks = Math.floor(self.height_ / pixelsPerTick); var vv = minV; - + var lmv = Dygraph.log10(minV); + var lxv = Dygraph.log10(maxV); + var logMultiplier = (lxv - lmv) / nTicks; + var multiplier = Math.pow(Dygraph.LOG_SCALE, logMultiplier); // Construct the set of ticks. for (var i = 0; i < nTicks; i++) { ticks.push( {v: vv} ); - vv = vv * Dygraph.LOG_SCALE; + vv = vv * multiplier; } } else { // Basic idea: