mirror of
https://github.com/Aider-AI/aider.git
synced 2025-06-04 19:55:00 +00:00
fix: update Chart.js scales config and add null checks for labels
This commit is contained in:
parent
7d79408683
commit
0c9d4dd123
1 changed files with 10 additions and 20 deletions
|
@ -66,12 +66,12 @@ The model also has to successfully apply all its changes to the source file with
|
||||||
label: 'Percent completed correctly',
|
label: 'Percent completed correctly',
|
||||||
data: [],
|
data: [],
|
||||||
backgroundColor: function(context) {
|
backgroundColor: function(context) {
|
||||||
const label = context.chart.data.labels[context.dataIndex];
|
const label = context.chart.data.labels[context.dataIndex] || '';
|
||||||
return label.includes('3.5 Haiku') ? 'rgba(255, 99, 132, 0.2)' : 'rgba(54, 162, 235, 0.2)';
|
return (label && label.includes('3.5 Haiku')) ? 'rgba(255, 99, 132, 0.2)' : 'rgba(54, 162, 235, 0.2)';
|
||||||
},
|
},
|
||||||
borderColor: function(context) {
|
borderColor: function(context) {
|
||||||
const label = context.chart.data.labels[context.dataIndex];
|
const label = context.chart.data.labels[context.dataIndex] || '';
|
||||||
return label.includes('3.5 Haiku') ? 'rgba(255, 99, 132, 1)' : 'rgba(54, 162, 235, 1)';
|
return (label && label.includes('3.5 Haiku')) ? 'rgba(255, 99, 132, 1)' : 'rgba(54, 162, 235, 1)';
|
||||||
},
|
},
|
||||||
borderWidth: 1
|
borderWidth: 1
|
||||||
}]
|
}]
|
||||||
|
@ -123,14 +123,9 @@ The model also has to successfully apply all its changes to the source file with
|
||||||
data: leaderboardData,
|
data: leaderboardData,
|
||||||
options: {
|
options: {
|
||||||
scales: {
|
scales: {
|
||||||
yAxes: [{
|
y: {
|
||||||
scaleLabel: {
|
beginAtZero: true
|
||||||
display: true,
|
}
|
||||||
},
|
|
||||||
ticks: {
|
|
||||||
beginAtZero: true
|
|
||||||
}
|
|
||||||
}]
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
@ -248,14 +243,9 @@ Therefore, results are available for fewer models.
|
||||||
data: leaderboardData,
|
data: leaderboardData,
|
||||||
options: {
|
options: {
|
||||||
scales: {
|
scales: {
|
||||||
yAxes: [{
|
y: {
|
||||||
scaleLabel: {
|
beginAtZero: true
|
||||||
display: true,
|
}
|
||||||
},
|
|
||||||
ticks: {
|
|
||||||
beginAtZero: true
|
|
||||||
}
|
|
||||||
}]
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue