+ ctx.fillText(showdate(tmax), px(tmax), py(0) + 40);
+ }
+
+ function getcomby(lo, hi) {
+ var comb = [], lb = [];
+ var d = hi - lo;
+ var ord = Math.pow(10, Math.floor(Math.log10(d)));
+ var scl = Math.floor(d / ord);
+ var inc, inc2, first, x, lb;
+
+ if (scl < 2) { inc = 0.1; inc2 = 0.2; }
+ else if (scl < 5) { inc = 0.1; inc2 = 0.5; }
+ else { inc = 0.5; inc2 = 1; }
+ inc *= ord;
+ inc2 *= ord;
+ first = (Math.floor(lo / inc) + 1) * inc;
+ for (x = 0; x < (d / inc) - 1.2; x++)
+ comb.push(first + inc * x);
+ first = (Math.floor(lo / inc2) + 1) * inc2;
+ for (x = 0; x < (d / inc2) - 1.2; x++)
+ lb.push(first + inc2 * x);
+ //dbg.innerHTML = "ord=" + ord + "<br>inc=" + inc + "<br>"
+ // + comb + "<br>" + lb;
+ return [comb, lb];