From d91c362f78edd8becd7e851559cb984149dc7ff0 Mon Sep 17 00:00:00 2001 From: str4d Date: Fri, 25 Aug 2017 11:12:33 +0100 Subject: [PATCH] Add links to export comparison charts as PNGs --- codespeed/static/js/comparison.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/codespeed/static/js/comparison.js b/codespeed/static/js/comparison.js index b05d77e6..cf723697 100644 --- a/codespeed/static/js/comparison.js +++ b/codespeed/static/js/comparison.js @@ -54,9 +54,14 @@ function refreshContent() { if (benchmarks.length === 0) { continue; } var plotid = "plot" + plotcounter; - $("#plotwrapper").append('
'); + var pngid = "pnglink" + plotcounter; + $("#plotwrapper").append('
PNG
'); plotcounter++; renderComparisonPlot(plotid, benchmarks, exes, enviros, conf.bas, conf.chart, conf.hor); + $("#" + pngid).data("plot", plotid); + $("#" + pngid).click(function() { + window.location = $("#" + $(this).data("plot")).jqplotToImageStr(); + }); } }); }