Repository navigation
Set canvas html element display: 'inline-block' instead of 'block' #12004
Unanswered
rogermedico
asked this question in
Q&A
Replies: 1 comment
|
Set an inline style before constructing the chart: <canvas id="myChart" style="display: inline-block;"></canvas>Or in JavaScript: const canvas = document.getElementById('myChart');
canvas.style.display = 'inline-block';
const chart = new Chart(canvas, config);The line you found is a fallback assignment: style.display = style.display || 'block';With an existing inline value, There is no need to edit Chart.js's source or use |
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Hello! I'm trying to change style applied to canvas html element. But I cannot make it, if someone knows how to set it i will appreciate his help.
I know that is something related to this
Chart.js/src/platform/platform.dom.js
Line 65 in b24cb2f
/roger
All reactions