You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Chart.js doesn't support creating a responsive chart from an orphan canvas, and I don't think this will be fixed anytime soon since it would require to monitor extra DOM activity to know when the canvas is added to the tree (which may be beyond the library responsibility, /cc @chartjs/maintainers).
Depending on your use case, immediate alternatives are:
if you don't need responsiveness, then turn it off via options: options: { responsive: false }
else, make sure to insert your canvas in the tree before creating the chart
Note that this case should work fine when the new context acquisition method from a div node will be implemented (proposal).
Expected Behavior
It should work.
Current Behavior
An exception is thrown:
Possible Solution
Do not depend on parent element for watching resizes.
Steps to Reproduce (for bugs)
Context
Trying to display a chart.
Environment
The text was updated successfully, but these errors were encountered: