Skip to content

Commit cfd458d

Browse files
committed
Add link to export timeline charts as PNGs
1 parent 33b2a3d commit cfd458d

File tree

3 files changed

+24
-1
lines changed

3 files changed

+24
-1
lines changed

codespeed/static/css/main.css

+16
Original file line numberDiff line numberDiff line change
@@ -484,6 +484,22 @@ p.note {
484484
background-image: url(../images/note.png);
485485
}
486486

487+
div.plotpng a {
488+
background-color: #F1F1F1;
489+
background-repeat: no-repeat;
490+
background-position: 3px;
491+
-moz-border-radius: 10px;
492+
-webkit-border-radius: 10px;
493+
border-radius: 10px;
494+
-moz-box-shadow: 3px 3px 3px #888;
495+
-webkit-box-shadow: 3px 3px 3px #888;
496+
box-shadow: 3px 3px 3px #888;
497+
float: right;
498+
margin-top: 20px;
499+
padding: 1em;
500+
text-decoration: underline;
501+
}
502+
487503
div.footer{
488504
color: white;
489505
font-size: small;

codespeed/static/css/timeline.css

+3
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
11
select#baseline {
22
width: 100%;
33
}
4+
div#plotdescription {
5+
margin-right: 55px;
6+
}

codespeed/static/js/timeline.js

+5-1
Original file line numberDiff line numberDiff line change
@@ -165,7 +165,11 @@ function renderPlot(data) {
165165
digits++;
166166
}
167167
}
168-
$("#plotgrid").html('<div id="plot"></div><div id="plotdescription"></div>');
168+
$("#plotgrid").html('<div id="plot"></div><div class="plotpng"><a id="pnglink" href="#">PNG</a></div><div id="plotdescription"></div>');
169+
170+
$("#pnglink").click(function() {
171+
window.location = $("#plot").jqplotToImageStr();
172+
});
169173

170174
if (data.benchmark_description) {
171175
$("#plotdescription").html('<p class="note"><i>' + data.benchmark + '</i>: ' + data.benchmark_description + '</p>');

0 commit comments

Comments
 (0)