fix: Improve blame chart labels and stacking

This commit is contained in:
Paul Gauthier 2024-12-26 19:57:57 -04:00 committed by Paul Gauthier (aider)
parent 7293263773
commit a19f8996b8

View file

@ -24,14 +24,14 @@ document.addEventListener('DOMContentLoaded', function () {
var linesData = { var linesData = {
labels: labels, labels: labels,
datasets: [{ datasets: [{
label: 'Lines by aider', label: 'Aider',
data: [{% for row in site.data.blame %}{ x: '{{ row.end_tag }}', y: {{ row.aider_total }} },{% endfor %}], data: [{% for row in site.data.blame %}{ x: '{{ row.end_tag }}', y: {{ row.aider_total }} },{% endfor %}],
backgroundColor: 'rgba(54, 162, 235, 0.8)', backgroundColor: 'rgba(54, 162, 235, 0.8)',
borderColor: 'rgba(54, 162, 235, 1)', borderColor: 'rgba(54, 162, 235, 1)',
borderWidth: 1 borderWidth: 1
}, },
{ {
label: 'Lines by human', label: 'Human',
data: [{% for row in site.data.blame %}{ x: '{{ row.end_tag }}', y: {{ row.total_lines | minus: row.aider_total }} },{% endfor %}], data: [{% for row in site.data.blame %}{ x: '{{ row.end_tag }}', y: {{ row.total_lines | minus: row.aider_total }} },{% endfor %}],
backgroundColor: 'rgba(255, 99, 132, 0.8)', backgroundColor: 'rgba(255, 99, 132, 0.8)',
borderColor: 'rgba(255, 99, 132, 1)', borderColor: 'rgba(255, 99, 132, 1)',
@ -45,7 +45,6 @@ document.addEventListener('DOMContentLoaded', function () {
options: { options: {
scales: { scales: {
x: { x: {
stacked: true,
type: 'category', type: 'category',
title: { title: {
display: true, display: true,
@ -96,6 +95,7 @@ document.addEventListener('DOMContentLoaded', function () {
scales: { scales: {
x: { x: {
type: 'category', type: 'category',
stacked: true,
title: { title: {
display: true, display: true,
text: 'Version' text: 'Version'
@ -129,7 +129,7 @@ document.addEventListener('DOMContentLoaded', function () {
}, },
title: { title: {
display: true, display: true,
text: 'Lines of new code by author, by release', text: 'Lines of new code, by release',
font: { font: {
size: 16 size: 16
} }