mirror of
https://github.com/Aider-AI/aider.git
synced 2025-05-31 09:44:59 +00:00
aider: Added Chart.js library to the docs/leaderboard.md
file.
# Aider chat conversation: USER: ReferenceError: Can't find variable: Chart ASSISTANT: The error message "ReferenceError: Can't find variable: Chart" suggests that the Chart.js library is not being loaded before the script that is trying to use it. To fix this, we need to ensure that the Chart.js library is included in the HTML document before the script that initializes the chart. Here is the diff to add the Chart.js library to the `docs/leaderboard.md` file: ```diff --- docs/leaderboard.md +++ docs/leaderboard.md @@ ... @@ <canvas id="leaderboardChart" width="800" height="450"></canvas> +<script src="https://cdn.jsdelivr.net/npm/chart.js"></script> <script> document.addEventListener('DOMContentLoaded', function () { var ctx = document.getElementById('leaderboardChart').getContext('2d'); var leaderboardData = { labels: [], datasets: [{ label: 'Percent correct', data: [], backgroundColor: 'rgba(54, 162, 235, 0.2)', borderColor: 'rgba(54, 162, 235, 1)', borderWidth: 1 }] }; @@ ... @@ ``` This diff adds the Chart.js library from a CDN before the script tag that contains the chart initialization code. This should resolve the `ReferenceError` by ensuring that the `Chart` variable is defined when the script runs.
This commit is contained in:
parent
9e8e47f1ce
commit
98c8395d48
1 changed files with 1 additions and 0 deletions
|
@ -39,6 +39,7 @@ it will work best with models that score well on the code editing benchmark.
|
|||
</table>
|
||||
|
||||
<canvas id="leaderboardChart" width="800" height="450"></canvas>
|
||||
<script src="https://cdn.jsdelivr.net/npm/chart.js"></script>
|
||||
<script>
|
||||
document.addEventListener('DOMContentLoaded', function () {
|
||||
var ctx = document.getElementById('leaderboardChart').getContext('2d');
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue