From 576ac66a224a8753e8b7075b47637a1ad520904d Mon Sep 17 00:00:00 2001 From: baz Date: Wed, 11 Jun 2025 01:33:52 +0100 Subject: [PATCH] Add hours to data labels --- commands/100-games/chartbeatlengths.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/commands/100-games/chartbeatlengths.js b/commands/100-games/chartbeatlengths.js index 7525ce9..d3e6863 100644 --- a/commands/100-games/chartbeatlengths.js +++ b/commands/100-games/chartbeatlengths.js @@ -70,14 +70,14 @@ module.exports = { { values.push(timeData[i].normally / 3600); 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)`); } else if (timeData[i].hastily) { values.push(timeData[i].hastily / 3600); 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)`); } }