Fix some bugs in hovertips, y-axis formatting, and v8 y-axis orientation.
This commit is contained in:
Родитель
214723637f
Коммит
faf84fded6
|
@ -53,7 +53,6 @@ AWFY.compute = function (xhr) {
|
|||
direction: blobgraph.direction,
|
||||
aggregate: blobgraph.aggregate,
|
||||
timelist: blobgraph.timelist,
|
||||
timemap: blobgraph.timemap,
|
||||
earliest: blobgraph.earliest,
|
||||
info: blobgraph.lines
|
||||
};
|
||||
|
|
|
@ -108,9 +108,26 @@ Display.prototype.draw = function () {
|
|||
options.borderColor = "#BEBEBE";
|
||||
options.legend = { show: false };
|
||||
options.xaxis = { };
|
||||
options.yaxis = { min: 0 };
|
||||
options.yaxis = { };
|
||||
options.grid = { hoverable: true, clickable: true };
|
||||
|
||||
// Aggregate view starts from 0. We space things out when zooming in.
|
||||
if (this.graph.aggregate)
|
||||
options.yaxis.min = 0;
|
||||
|
||||
if (this.graph.direction == 1) {
|
||||
options.yaxis.transform = function (v) {
|
||||
return -v;
|
||||
};
|
||||
options.yaxis.inverseTransform = function (v) {
|
||||
return -v;
|
||||
};
|
||||
} else {
|
||||
options.yaxis.tickFormatter = function (v, axis) {
|
||||
return v + 'ms';
|
||||
};
|
||||
}
|
||||
|
||||
if (this.historical) {
|
||||
// If the graph has both historical and recent points, indicated by
|
||||
// the "historical" midpoint, then we change some graph formatting
|
||||
|
@ -146,19 +163,6 @@ Display.prototype.draw = function () {
|
|||
this.plot = $.plot(this.elt, this.graph.lines, options);
|
||||
}
|
||||
|
||||
// Display.prototype.checkHoverDelta(pos) {
|
||||
// if (!this.lastPos)
|
||||
// return false;
|
||||
// if (pos.pageX - this.lastPos.pageX >= 0 &&
|
||||
// pos.pageX - this.lastPos.pageX <= 5 &&
|
||||
// pos.pageY - this.lastPos.pageY >= 0 &&
|
||||
// pos.pageY - this.lastPos.pageY <= 5)
|
||||
// {
|
||||
// return true;
|
||||
// }
|
||||
// return false;
|
||||
// }
|
||||
|
||||
Display.prototype.createToolTip = function (item, extended) {
|
||||
var so = extended ? '<strong>' : '';
|
||||
var sc = extended ? '</strong>' : '';
|
||||
|
|
|
@ -79,7 +79,7 @@ ToolTip.prototype.onDrag = function (event, ui) {
|
|||
return;
|
||||
this.line.setAttribute('x2', this.midpoint().x);
|
||||
this.line.setAttribute('y2', this.midpoint().y);
|
||||
this.svg.height($('body').height());
|
||||
this.svg.height($('window').height());
|
||||
}
|
||||
|
||||
ToolTip.prototype.attachLine = function (color) {
|
||||
|
@ -102,7 +102,7 @@ ToolTip.prototype.attachLine = function (color) {
|
|||
line.setAttribute('stroke-width', 2);
|
||||
$(line).appendTo(svg);
|
||||
|
||||
svg.height($('body').height());
|
||||
svg.height($('window').height());
|
||||
svg.appendTo('body');
|
||||
this.svg = svg;
|
||||
this.line = line;
|
||||
|
|
Загрузка…
Ссылка в новой задаче