Skip to content

Commit d91c362

Browse files
committed
Add links to export comparison charts as PNGs
1 parent cfd458d commit d91c362

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

codespeed/static/js/comparison.js

+6-1
Original file line numberDiff line numberDiff line change
@@ -54,9 +54,14 @@ function refreshContent() {
5454
if (benchmarks.length === 0) { continue; }
5555

5656
var plotid = "plot" + plotcounter;
57-
$("#plotwrapper").append('<div id="' + plotid + '" class="compplot"></div>');
57+
var pngid = "pnglink" + plotcounter;
58+
$("#plotwrapper").append('<div class="plotpng"><a id="' + pngid + '" href="#">PNG</a></div><div id="' + plotid + '" class="compplot"></div>');
5859
plotcounter++;
5960
renderComparisonPlot(plotid, benchmarks, exes, enviros, conf.bas, conf.chart, conf.hor);
61+
$("#" + pngid).data("plot", plotid);
62+
$("#" + pngid).click(function() {
63+
window.location = $("#" + $(this).data("plot")).jqplotToImageStr();
64+
});
6065
}
6166
});
6267
}

0 commit comments

Comments
 (0)