diff --git a/aider/website/_includes/code-in-json-benchmark.js b/aider/website/_includes/code-in-json-benchmark.js index befcdc285..a2bf7b050 100644 --- a/aider/website/_includes/code-in-json-benchmark.js +++ b/aider/website/_includes/code-in-json-benchmark.js @@ -108,6 +108,7 @@ document.addEventListener('DOMContentLoaded', function () { plugins: [{ afterDraw: function(chart) { var ctx = chart.ctx; + var isWideScreen = window.innerWidth > 768; // Assuming 768px as the breakpoint for wide screens chart.data.datasets.forEach(function(dataset, i) { var meta = chart.getDatasetMeta(i); meta.data.forEach(function(bar, index) { @@ -116,7 +117,8 @@ document.addEventListener('DOMContentLoaded', function () { ctx.fillStyle = '#000000'; ctx.textAlign = 'center'; ctx.textBaseline = 'bottom'; - ctx.fillText(Math.round(data) + '%', bar.x, bar.y - 5); + var displayText = isWideScreen ? data.toFixed(1) + '%' : Math.round(data) + '%'; + ctx.fillText(displayText, bar.x, bar.y - 5); } }); });