axis.yrange = axis.maxyval - axis.minyval;
axis.yscale = (axis.yrange != 0 ? 1.0 / axis.yrange : 1.0);
- axis.ylogrange = Math.log(axis.maxyval) - Math.log(axis.minyval);
+ axis.ylogrange = Dygraph.log10(axis.maxyval) - Dygraph.log10(axis.minyval);
axis.ylogscale = (axis.ylogrange != 0 ? 1.0 / axis.ylogrange : 1.0);
}
};
var yval;
if (this.dygraph_.attr_("logscale")) {
- yval = 1.0 - ((Math.log(parseFloat(item[1])) - Math.log(axis.minyval)) * axis.ylogscale); // really should just be yscale.
+ yval = 1.0 - ((Dygraph.log10(parseFloat(item[1])) - Dygraph.log10(axis.minyval)) * axis.ylogscale); // really should just be yscale.
} else {
yval = 1.0 - ((parseFloat(item[1]) - axis.minyval) * axis.yscale);
}
Dygraph.AXIS_LINE_WIDTH = 0.3;
Dygraph.LOG_SCALE = 10;
-Dygraph.LOG_BASE_E_OF_TEN = Math.log(Dygraph.LOG_SCALE);
+Dygraph.LN_TEN = Math.log(Dygraph.LOG_SCALE);
Dygraph.log10 = function(x) {
- return Math.log(x) / Dygraph.LOG_BASE_E_OF_TEN;
+ return Math.log(x) / Dygraph.LN_TEN;
}
// Default attribute values.
/**
* Convert from data x coordinates to canvas/div X coordinate.
* If specified, do this conversion for the coordinate system of a particular
- * axis. Uses the first axis by default.
- * returns a single value or null if x is null.
+ * axis.
+ * Returns a single value or null if x is null.
*/
Dygraph.prototype.toDomXCoord = function(x) {
if (x == null) {