feat: add legend to chart showing diff and whole format patterns

This commit is contained in:
Paul Gauthier (aider) 2024-12-06 14:46:43 -08:00
parent 04662f0875
commit d53002a494

View file

@ -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,