Skip to content

Commit 95fbbf4

Browse files
oe-build-perf-report: Update chart tooltip format and datazoom
1 parent c441047 commit 95fbbf4

File tree

1 file changed

+14
-9
lines changed

1 file changed

+14
-9
lines changed

scripts/lib/build_perf/html/measurement_chart.html

Lines changed: 14 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -13,22 +13,29 @@
1313
// Convert raw data to the format: [time, value]
1414
const data = rawData.map(([commit, value, time]) => {
1515
return [
16-
new Date(time * 1000).getTime(), // The Date object takes values in milliseconds rather than seconds. So to use a Unix timestamp we have to multiply it by 1000.
17-
Array.isArray(value) ? convertToMinute(value) : value // Assuming the array values are duration in the format [hours, minutes, seconds, milliseconds]
16+
// The Date object takes values in milliseconds rather than seconds. So to use a Unix timestamp we have to multiply it by 1000.
17+
new Date(time * 1000).getTime(),
18+
// Assuming the array values are duration in the format [hours, minutes, seconds, milliseconds]
19+
Array.isArray(value) ? convertToMinute(value) : value
1820
]
1921
});
2022

2123
// Set chart options
2224
const option = {
2325
tooltip: {
2426
trigger: 'axis',
25-
valueFormatter: (value) => value.toFixed(2)
27+
valueFormatter: (value) => {
28+
const hours = Math.floor(value/60)
29+
const minutes = Math.floor(value % 60)
30+
const seconds = Math.floor((value * 60) % 60)
31+
return hours + ':' + minutes + ':' + seconds
32+
}
2633
},
2734
xAxis: {
2835
type: 'time',
2936
},
3037
yAxis: {
31-
name: '{{ measurement.value_type.quantity }}' == 'time' ? 'Duration (minutes)' : 'Disk size (MB)',
38+
name: '{{ measurement.value_type.quantity }}' == 'time' ? 'Duration in minutes' : 'Disk size in MB',
3239
type: 'value',
3340
min: function(value) {
3441
return Math.round(value.min - 0.5);
@@ -39,12 +46,10 @@
3946
},
4047
dataZoom: [
4148
{
42-
type: 'inside',
49+
type: 'slider',
50+
xAxisIndex: 0,
51+
filterMode: 'none'
4352
},
44-
{
45-
start: 0,
46-
end: 100
47-
}
4853
],
4954
series: [
5055
{

0 commit comments

Comments
 (0)