scale = base_scale * mults[j];
low_val = Math.floor(minV / scale) * scale;
high_val = Math.ceil(maxV / scale) * scale;
- nTicks = (high_val - low_val) / scale;
+ nTicks = Math.abs(high_val - low_val) / scale;
var spacing = self.height_ / nTicks;
// wish I could break out of both loops at once...
if (spacing > pixelsPerTick) break;
k_labels = [ "k", "M", "G", "T" ];
}
+ // Allow reverse y-axis if it's explicitly requested.
+ if (low_val > high_val) scale *= -1;
+
for (var i = 0; i < nTicks; i++) {
var tickV = low_val + i * scale;
var absTickV = Math.abs(tickV);
// TODO(danvk): this doesn't match the constructor logic
this.layout_.updateOptions({ 'errorBars': this.attr_("errorBars") });
- if (attrs['file'] && attrs['file'] != this.file_) {
+ if (attrs['file']) {
this.file_ = attrs['file'];
this.start_();
} else {