mirror of
https://github.com/Aider-AI/aider.git
synced 2025-06-01 02:05:00 +00:00
adjust canvas height
This commit is contained in:
parent
db5dbb5d13
commit
c3fcaeac5e
2 changed files with 7 additions and 19 deletions
|
@ -1,6 +1,4 @@
|
||||||
<div id="chartContainer" style="position: relative; height: 0; padding-bottom: 50%; margin-bottom: 20px;">
|
<canvas id="passRateChart" width="800" height="400" style="margin-bottom: 20px"></canvas>
|
||||||
<canvas id="passRateChart" style="position: absolute; width: 100%; height: 100%;"></canvas>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<script src="https://cdn.jsdelivr.net/npm/chart.js"></script>
|
<script src="https://cdn.jsdelivr.net/npm/chart.js"></script>
|
||||||
<script>
|
<script>
|
||||||
|
@ -109,12 +107,8 @@ document.addEventListener('DOMContentLoaded', function () {
|
||||||
|
|
||||||
// Adjust chart height based on screen width
|
// Adjust chart height based on screen width
|
||||||
function adjustChartHeight() {
|
function adjustChartHeight() {
|
||||||
var container = document.getElementById('chartContainer');
|
var container = document.getElementById('passRateChart');
|
||||||
if (window.innerWidth < 600) {
|
container.height = 600;
|
||||||
container.style.paddingBottom = '75%'; // Increase height on small screens
|
|
||||||
} else {
|
|
||||||
container.style.paddingBottom = '50%'; // Default height
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Call the function initially and on window resize
|
// Call the function initially and on window resize
|
||||||
|
|
|
@ -1,7 +1,5 @@
|
||||||
<div id="syntaxErrorsContainer" style="position: relative; height: 0; padding-bottom: 50%; margin-bottom: 20px;">
|
<canvas id="passRateChart" width="800" height="400" style="margin-bottom: 20px"></canvas>
|
||||||
<canvas id="syntaxErrorsChart" style="position: absolute; width: 100%; height: 100%;"></canvas>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
document.addEventListener('DOMContentLoaded', function () {
|
document.addEventListener('DOMContentLoaded', function () {
|
||||||
var ctx = document.getElementById('syntaxErrorsChart').getContext('2d');
|
var ctx = document.getElementById('syntaxErrorsChart').getContext('2d');
|
||||||
|
@ -108,12 +106,8 @@ document.addEventListener('DOMContentLoaded', function () {
|
||||||
|
|
||||||
// Adjust chart height based on screen width
|
// Adjust chart height based on screen width
|
||||||
function adjustChartHeight() {
|
function adjustChartHeight() {
|
||||||
var container = document.getElementById('syntaxErrorsContainer');
|
var container = document.getElementById('passRateChart');
|
||||||
if (window.innerWidth < 600) {
|
container.height = 600;
|
||||||
container.style.paddingBottom = '75%'; // Increase height on small screens
|
|
||||||
} else {
|
|
||||||
container.style.paddingBottom = '50%'; // Default height
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Call the function initially and on window resize
|
// Call the function initially and on window resize
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue