From 8e3cc8b4ae4a3ee13e9b32456583387f995c7984 Mon Sep 17 00:00:00 2001 From: Hannes Verschore Date: Wed, 23 Jul 2014 15:36:27 -0700 Subject: [PATCH] Label y-ax --- website/frontpage.js | 21 ++++++++++++++------- website/index.html | 8 ++++++++ website/style.css | 29 +++++++++++++++++++++++++++++ 3 files changed, 51 insertions(+), 7 deletions(-) diff --git a/website/frontpage.js b/website/frontpage.js index 7545d50..e4c56ac 100644 --- a/website/frontpage.js +++ b/website/frontpage.js @@ -218,7 +218,7 @@ Display.prototype.draw = function () { options.borderWidth = 1.5; options.borderColor = "#BEBEBE"; options.legend = { show: false }; - options.xaxis = { }; + options.xaxis = { }; options.yaxis = { }; options.grid = { hoverable: true, clickable: true }; options.selection = { mode: 'x' } @@ -228,16 +228,12 @@ Display.prototype.draw = function () { options.yaxis.min = 0; if (this.graph.direction == 1) { - options.yaxis.transform = function (v) { + options.yaxis.transform = function (v) { return -v; }; - options.yaxis.inverseTransform = function (v) { + options.yaxis.inverseTransform = function (v) { return -v; }; - } else { - options.yaxis.tickFormatter = function (v, axis) { - return v + 'ms'; - }; } if (this.graph.aggregate && this.historical) { @@ -280,6 +276,17 @@ Display.prototype.draw = function () { } this.plot = $.plot(this.elt, this.graph.lines, options); + + if (this.graph.direction == 1) { + var yaxisLabel = $("
") + .text("Score") + .appendTo(this.elt); + } else { + var yaxisLabel = $("
") + .text("Execution Time (ms)") + .appendTo(this.elt); + } + yaxisLabel.css("margin-top", yaxisLabel.width() / 2 - 20); } Display.prototype.plotSelected = function (event, ranges) { diff --git a/website/index.html b/website/index.html index 828abd2..62fd336 100755 --- a/website/index.html +++ b/website/index.html @@ -16,6 +16,14 @@ + + + + + + + +