Skip to content

Commit

Permalink
oe-build-perf-report: Update chart tooltip format and datazoom
Browse files Browse the repository at this point in the history
  • Loading branch information
ninetteadhikari committed Mar 25, 2024
1 parent c441047 commit 95fbbf4
Showing 1 changed file with 14 additions and 9 deletions.
23 changes: 14 additions & 9 deletions scripts/lib/build_perf/html/measurement_chart.html
Original file line number Diff line number Diff line change
Expand Up @@ -13,22 +13,29 @@
// Convert raw data to the format: [time, value]
const data = rawData.map(([commit, value, time]) => {
return [
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.
Array.isArray(value) ? convertToMinute(value) : value // Assuming the array values are duration in the format [hours, minutes, seconds, milliseconds]
// The Date object takes values in milliseconds rather than seconds. So to use a Unix timestamp we have to multiply it by 1000.
new Date(time * 1000).getTime(),
// Assuming the array values are duration in the format [hours, minutes, seconds, milliseconds]
Array.isArray(value) ? convertToMinute(value) : value
]
});

// Set chart options
const option = {
tooltip: {
trigger: 'axis',
valueFormatter: (value) => value.toFixed(2)
valueFormatter: (value) => {
const hours = Math.floor(value/60)
const minutes = Math.floor(value % 60)
const seconds = Math.floor((value * 60) % 60)
return hours + ':' + minutes + ':' + seconds
}
},
xAxis: {
type: 'time',
},
yAxis: {
name: '{{ measurement.value_type.quantity }}' == 'time' ? 'Duration (minutes)' : 'Disk size (MB)',
name: '{{ measurement.value_type.quantity }}' == 'time' ? 'Duration in minutes' : 'Disk size in MB',
type: 'value',
min: function(value) {
return Math.round(value.min - 0.5);
Expand All @@ -39,12 +46,10 @@
},
dataZoom: [
{
type: 'inside',
type: 'slider',
xAxisIndex: 0,
filterMode: 'none'
},
{
start: 0,
end: 100
}
],
series: [
{
Expand Down

0 comments on commit 95fbbf4

Please sign in to comment.