Add hours to data labels

This commit is contained in:
baz 2025-06-11 01:33:52 +01:00
parent ef8326b2d6
commit 576ac66a22

View File

@ -70,14 +70,14 @@ module.exports = {
{ {
values.push(timeData[i].normally / 3600); values.push(timeData[i].normally / 3600);
const game = beatGameIGDBEntries.filter(item => item.id == timeData[i].game_id); const game = beatGameIGDBEntries.filter(item => item.id == timeData[i].game_id);
labels.push(game[0].name); labels.push(`${game[0].name}, ${Math.round(timeData[i].normally / 3600)} hours`);
backgroundColors.push(`rgba(${Math.random() * 255}, ${Math.random() * 255}, ${Math.random() * 255}, 0.5)`); backgroundColors.push(`rgba(${Math.random() * 255}, ${Math.random() * 255}, ${Math.random() * 255}, 0.5)`);
} }
else if (timeData[i].hastily) else if (timeData[i].hastily)
{ {
values.push(timeData[i].hastily / 3600); values.push(timeData[i].hastily / 3600);
const game = beatGameIGDBEntries.filter(item => item.id == timeData[i].game_id); const game = beatGameIGDBEntries.filter(item => item.id == timeData[i].game_id);
labels.push(game[0].name); labels.push(`${game[0].name}, ${Math.round(timeData[i].hastily / 3600)} hours`);
backgroundColors.push(`rgba(${Math.random() * 255}, ${Math.random() * 255}, ${Math.random() * 255}, 0.5)`); backgroundColors.push(`rgba(${Math.random() * 255}, ${Math.random() * 255}, ${Math.random() * 255}, 0.5)`);
} }
} }