Skip to content

Commit

Permalink
Add workaround for ChartJS shrinking chart bug
Browse files Browse the repository at this point in the history
ChartJS has a bug causing charts to continually shrink and reset size when the browser
zoom level is not 100%. See chartjs/Chart.js#10890 for details.
  • Loading branch information
cblanken committed Aug 2, 2024
1 parent 2b2911e commit 820d01e
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion lute/templates/stats/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ <h2>Words read</h2>
</ul>
</table>

<div style="width:60%;">
<div style="position: relative; aspect-ratio: 3">
<canvas id="wordCountChart"></canvas>
</div>

Expand Down Expand Up @@ -86,6 +86,7 @@ <h2>Words read</h2>
datasets: datasets
},
options: {
maintainAspectRatio: false,
scales: {
// Unable to get the "time" scale working correctly,
// so now the data just has all of the dates.
Expand Down

0 comments on commit 820d01e

Please sign in to comment.