Skip to content

Commit

Permalink
[TASK] Make Chart.js canvas responsive, add workaround for flexbox co…
Browse files Browse the repository at this point in the history
  • Loading branch information
deoostfrees committed Nov 13, 2024
1 parent 25e2825 commit 1e7bea7
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 2 deletions.
1 change: 1 addition & 0 deletions Resources/Private/Build/JavaScript/Backend/Diagram.js
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,7 @@ const LuxDiagram = function() {
labels: element.getAttribute('data-chart-labels').split(',')
},
options: {
maintainAspectRatio: false,
plugins: {
legend: {
display: true,
Expand Down
12 changes: 12 additions & 0 deletions Resources/Private/Sass/Modules.scss
Original file line number Diff line number Diff line change
Expand Up @@ -568,3 +568,15 @@ label {
padding: 0 5px;
}
}

/**
* Chart.js adjustments
*
*/
.lux *:has(> canvas) {
position: relative;
}

.lux canvas[data-chart="doughnut"] {
max-width: min-content;
}
Loading

0 comments on commit 1e7bea7

Please sign in to comment.