axis.ylogrange = Dygraph.log10(axis.maxyval) - Dygraph.log10(axis.minyval);
axis.ylogscale = (axis.ylogrange != 0 ? 1.0 / axis.ylogrange : 1.0);
+ if (axis.g.attr_("logscale") && isNaN(axis.ylogrange)) {
+ axis.g.error('axis ' + i + ' can\'t be displayed in log scale for range [' +
+ axis.minyval + ' - ' + axis.maxyval + ']');
+ }
}
};
for (var j = 0; j < dataset.length; j++) {
var item = dataset[j];
-
+
var yval;
if (axis.logscale) {
yval = 1.0 - ((Dygraph.log10(parseFloat(item[1])) - Dygraph.log10(axis.minyval)) * axis.ylogscale); // really should just be yscale.
};
var g0 = new Dygraph(document.getElementById("div_g0"),
- data0, { logscale : true });
- var g1 = new Dygraph(document.getElementById("div_g1"),
- data1, { logscale : true });
+ data0, { logscale : true, valueRange: [-1,100] });
+ // var g1 = new Dygraph(document.getElementById("div_g1"),
+ //data1, { logscale : true });
function setLogScale(val) {
g0.updateOptions({ logscale: val });
- g1.updateOptions({ logscale: val });
+ // g1.updateOptions({ logscale: val });
document.getElementById("linear").disabled = !val;
document.getElementById("log").disabled = val;
}