if (item) {
plot.highlight(item.series, item.datapoint);
buildid = ids[item.datapoint[0]];
window.location = "/build/"+buildid;
}
});
}
});
});
</script>
<h2>Store path size history (in MB)</h2>
<div id="placeholder-size" style="width:800px;height:400px;"></div>
<div id="overview-size" style="margin-left:50px;margin-top:20px;width:600px;height:50px"></div>
<script type="text/javascript">
$(function() {
var d = [];
var ids = [];
[% FOREACH prevbuild IN prevBuilds %][% IF prevbuild.resultInfo.size != 0 %]
d.push([[% prevbuild.resultInfo.starttime * 1000 %],[% prevbuild.resultInfo.size / (1024*1024.0) %]]);
ids[[% prevbuild.resultInfo.starttime * 1000 %]] = [% prevbuild.id %] ;
[% END %][% END %]
var options = {
xaxis: { mode: "time" },
selection: { mode: "x" },
points: { show: true },
lines: { show: true },
grid: {
clickable: true,
hoverable: true,
hoverFill: '#444',
hoverRadius: 4,
},
};
$('#generic-tabs').bind('tabsshow', function(event, ui) {
if (ui.panel.id == "tabs-history") {
var plot = $.plot($("#placeholder-size"), [d], options);
var overview = $.plot($("#overview-size"), [d], {
series: {
lines: { show: true, lineWidth: 1 },
shadowSize: 0
},
xaxis: { ticks: [], mode: "time" },
yaxis: { ticks: [], min: 0, autoscaleMargin: 0.1 },
selection: { mode: "x" }
});
// now connect the two
$("#placeholder-size").bind("plotselected", function (event, ranges) {
// do the zooming
plot = $.plot($("#placeholder-size"), [d],
$.extend(true, {}, options, {
xaxis: { min: ranges.xaxis.from, max: ranges.xaxis.to }
}));
// don't fire event on the overview to prevent eternal loop
overview.setSelection(ranges, true);
});
$("#overview-size").bind("plotselected", function (event, ranges) {
plot.setSelection(ranges);
});
$("#placeholder-size").bind("plotclick", function (e, pos, item) {