When rendering a word cloud with a large number of data points, words often overflow outside the canvas boundary. This issue occurs even when using the aspect ratio or responsive options provided by Chart.js. There is no way to ensure that the entire word cloud fits within the canvas bounds.
To Reproduce
- Use a large dataset to generate a word cloud.
- Observe that words are placed outside the canvas area.
Expected behavior
All words in the word cloud should remain within the render canvas.
Screenshots
I have attached a screenshot from your official website example to illustrate the issue.

Context
- Version: chart.js: ^4.4.4, chartjs-chart-wordcloud: ^4.4.2
- Browser: 131.0.6778.140 (64-Bit)
Suggested Solution
- Provide an option to set a zoom level or a fit-to-canvas property.
- Alternatively, add a configuration to auto-scale the word cloud to ensure all words fit within the canvas dimensions.
When rendering a word cloud with a large number of data points, words often overflow outside the canvas boundary. This issue occurs even when using the aspect ratio or responsive options provided by Chart.js. There is no way to ensure that the entire word cloud fits within the canvas bounds.
To Reproduce
Expected behavior
All words in the word cloud should remain within the render canvas.
Screenshots
I have attached a screenshot from your official website example to illustrate the issue.
Context
Suggested Solution