Skip to content

Commit 53a9602

Browse files
Show value in tooltip for bootstrap graph
1 parent 790038e commit 53a9602

File tree

1 file changed

+6
-7
lines changed

1 file changed

+6
-7
lines changed

site/static/bootstrap.html

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,8 @@
116116
tooltip.textContent = (
117117
fmtDate(new Date(u.data[0][dataIdx] * 1e3)) + " - " +
118118
commits[dataIdx][1].slice(0,10) + "\n" +
119-
u.series[seriesIdx].label
119+
u.series[seriesIdx].label + ": " +
120+
u.data[seriesIdx][dataIdx]/1e9 + " seconds"
120121
);
121122
}
122123

@@ -228,23 +229,21 @@
228229
// https://sashamaps.net/docs/resources/20-colors/
229230
let colors = [
230231
'#e6194b', '#3cb44b', '#ffe119', '#4363d8', '#f58231',
231-
'#911eb4', '#46f0f0', '#f032e6', '#bcf60c', '#fabebe',
232-
'#008080', '#e6beff', '#9a6324', '#fffac8', '#800000',
233-
'#aaffc3', '#808000', '#ffd8b1', '#000075', '#808080',
234-
'#ffffff', '#000000'
232+
'#911eb4', '#46f0f0', '#f032e6', '#a09b13', '#0ab0be',
233+
'red', 'green', 'blue', 'purple'
235234
];
236235
let crates = Object.keys(data.by_crate).sort();
237236
for (let crate of crates) {
238237
plotData.push(data.by_crate[crate]);
239238

240239
seriesOpts.push({
241240
label: crate,
242-
stroke: colors.pop(),
241+
stroke: colors.length ? colors.pop() : 'black',
243242
});
244243
}
245244

246245
let plotOpts = genPlotOpts({
247-
title: "Bootstrap timings for crates >= 10 seconds",
246+
title: "Bootstrap timings for crates >= 30 seconds",
248247
width: Math.floor(window.innerWidth) - 16,
249248
height: window.innerHeight * 0.75,
250249
yAxisLabel: "",

0 commit comments

Comments
 (0)