feat: Reverse order of bars and legend in chart

This commit is contained in:
Paul Gauthier (aider) 2024-09-26 17:28:04 -07:00
parent 6c946006e8
commit 7c8f0ea7b6

View file

@ -80,6 +80,10 @@ top coding models, as compared to their previous "solo" scores (striped bars).
borderColors.push(borderColorMapping["{{ item.model }}"]); borderColors.push(borderColorMapping["{{ item.model }}"]);
{% endfor %} {% endfor %}
{% endfor %} {% endfor %}
labels.reverse();
data.reverse();
backgroundColors.reverse();
borderColors.reverse();
new Chart(ctx, { new Chart(ctx, {
type: 'bar', type: 'bar',
data: { data: {
@ -160,7 +164,7 @@ top coding models, as compared to their previous "solo" scores (striped bars).
"gpt-4o": "rgba(54, 162, 235, 0.2)", "gpt-4o": "rgba(54, 162, 235, 0.2)",
"o1-mini": "rgba(255, 99, 132, 0.2)" "o1-mini": "rgba(255, 99, 132, 0.2)"
}; };
return Object.keys(colorMapping).map(function(key) { return Object.keys(colorMapping).reverse().map(function(key) {
return { return {
text: key, text: key,
fillStyle: colorMapping[key], fillStyle: colorMapping[key],