Modify chart to display both lines of code and percentage contributed by Aider

This commit is contained in:
Paul Gauthier (aider) 2024-07-29 12:03:42 -03:00
parent 994e9a1475
commit 148078ecac

View file

@ -13,20 +13,20 @@ document.addEventListener('DOMContentLoaded', function () {
{ {
x: '{{ row.end_date }}', x: '{{ row.end_date }}',
y: {{ row.aider_lines }}, y: {{ row.aider_lines }},
label: '{{ row.end_tag }}' r: {{ row.aider_percentage }},
label: '{{ row.end_tag }}',
percentage: {{ row.aider_percentage }}
}, },
{% endfor %} {% endfor %}
], ],
backgroundColor: 'rgba(54, 162, 235, 0.2)', backgroundColor: 'rgba(54, 162, 235, 0.2)',
borderColor: 'rgba(54, 162, 235, 1)', borderColor: 'rgba(54, 162, 235, 1)',
borderWidth: 1, borderWidth: 1
pointRadius: 5,
pointHoverRadius: 8
}] }]
}; };
var blameChart = new Chart(ctx, { var blameChart = new Chart(ctx, {
type: 'scatter', type: 'bubble',
data: blameData, data: blameData,
options: { options: {
scales: { scales: {
@ -61,9 +61,12 @@ document.addEventListener('DOMContentLoaded', function () {
tooltip: { tooltip: {
callbacks: { callbacks: {
label: function(context) { label: function(context) {
return `${context.raw.label}: ${context.raw.y} lines`; return `${context.raw.label}: ${context.raw.y} lines (${context.raw.percentage.toFixed(2)}%)`;
} }
} }
},
legend: {
display: false
} }
} }
} }