From d53002a494041c46db50e5febed6839985b41c38 Mon Sep 17 00:00:00 2001 From: "Paul Gauthier (aider)" Date: Fri, 6 Dec 2024 14:46:43 -0800 Subject: [PATCH] feat: add legend to chart showing diff and whole format patterns --- aider/website/_includes/edit-leaderboard.js | 23 +++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/aider/website/_includes/edit-leaderboard.js b/aider/website/_includes/edit-leaderboard.js index 59b916e4c..dc43555ad 100644 --- a/aider/website/_includes/edit-leaderboard.js +++ b/aider/website/_includes/edit-leaderboard.js @@ -89,6 +89,29 @@ document.addEventListener('DOMContentLoaded', function () { type: 'bar', data: leaderboardData, options: { + plugins: { + legend: { + display: true, + labels: { + generateLabels: function(chart) { + return [ + { + text: 'Diff format', + fillStyle: 'rgba(54, 162, 235, 0.2)', + strokeStyle: 'rgba(54, 162, 235, 1)', + lineWidth: 1 + }, + { + text: 'Whole format', + fillStyle: blueDiagonalPattern, + strokeStyle: 'rgba(54, 162, 235, 1)', + lineWidth: 1 + } + ]; + } + } + } + }, scales: { y: { beginAtZero: true,