This commit is contained in:
Hannes Verschore 2014-07-23 15:36:27 -07:00
Родитель d4f5e80aaa
Коммит 8e3cc8b4ae
3 изменённых файлов: 51 добавлений и 7 удалений

Просмотреть файл

@ -218,7 +218,7 @@ Display.prototype.draw = function () {
options.borderWidth = 1.5; options.borderWidth = 1.5;
options.borderColor = "#BEBEBE"; options.borderColor = "#BEBEBE";
options.legend = { show: false }; options.legend = { show: false };
options.xaxis = { }; options.xaxis = { };
options.yaxis = { }; options.yaxis = { };
options.grid = { hoverable: true, clickable: true }; options.grid = { hoverable: true, clickable: true };
options.selection = { mode: 'x' } options.selection = { mode: 'x' }
@ -228,16 +228,12 @@ Display.prototype.draw = function () {
options.yaxis.min = 0; options.yaxis.min = 0;
if (this.graph.direction == 1) { if (this.graph.direction == 1) {
options.yaxis.transform = function (v) { options.yaxis.transform = function (v) {
return -v; return -v;
}; };
options.yaxis.inverseTransform = function (v) { options.yaxis.inverseTransform = function (v) {
return -v; return -v;
}; };
} else {
options.yaxis.tickFormatter = function (v, axis) {
return v + 'ms';
};
} }
if (this.graph.aggregate && this.historical) { if (this.graph.aggregate && this.historical) {
@ -280,6 +276,17 @@ Display.prototype.draw = function () {
} }
this.plot = $.plot(this.elt, this.graph.lines, options); this.plot = $.plot(this.elt, this.graph.lines, options);
if (this.graph.direction == 1) {
var yaxisLabel = $("<div class='axisLabel yaxisLabel'></div>")
.text("Score")
.appendTo(this.elt);
} else {
var yaxisLabel = $("<div class='axisLabel yaxisLabel'></div>")
.text("Execution Time (ms)")
.appendTo(this.elt);
}
yaxisLabel.css("margin-top", yaxisLabel.width() / 2 - 20);
} }
Display.prototype.plotSelected = function (event, ranges) { Display.prototype.plotSelected = function (event, ranges) {

Просмотреть файл

@ -16,6 +16,14 @@
<script type="text/javascript" src="tooltip.js"></script> <script type="text/javascript" src="tooltip.js"></script>
</head> </head>
<body> <body>
<!--[if IE 6]><body class="ie ie6"><![endif]-->
<!--[if IE 7]><body class="ie ie7"><![endif]-->
<!--[if IE 8]><body class="ie ie8"><![endif]-->
<!--[if IE 9]><body class="ie ie9"><![endif]-->
<!--[if gt IE 9]><body class="ie"><![endif]-->
<!--[if !IE ]><!-->
<body>
<!--<![endif]-->
<script type="text/javascript"> <script type="text/javascript">
$(document).ready(function () { $(document).ready(function () {
AWFY.startup(); AWFY.startup();

Просмотреть файл

@ -121,3 +121,32 @@ h1 {
font-weight: bold; font-weight: bold;
} }
.axisLabel {
position: absolute;
text-align: center;
font-size: 0.9em;
}
.yaxisLabel {
top: 50%;
left: 2px;
margin: -25px;
transform: rotate(-90deg);
-o-transform: rotate(-90deg);
-ms-transform: rotate(-90deg);
-moz-transform: rotate(-90deg);
-webkit-transform: rotate(-90deg);
transform-origin: 0 0;
-o-transform-origin: 0 0;
-ms-transform-origin: 0 0;
-moz-transform-origin: 0 0;
-webkit-transform-origin: 0 0;
}
.ie7 .yaxisLabel, .ie8 .yaxisLabel {
top: 40%;
font-size: 1.1em;
filter: progid:DXImageTransform.Microsoft.Matrix(M11=0.0, M12=0.33, M21=-0.33, M22=0.0,sizingMethod='auto expand');
}