Scatter Chart
✓ Published1🌍 Public
This example demonstrates a scatter chart using Chart.js, with the scatter plot drawn on an HTML canvas element. The chart is configured with `responsive: true` to adapt to its container’s width, which is set to 50% of the page. The code initializes the chart inside `window.onload` by accessing the canvas context via `getContext("2d")` and creating a new `Chart(ctx).Scatter()` instance. A `randomScalingFactor` function generates random integer data points scaled to 100, but the chart is initialized with empty `scatterData`, so no visible points render until data is provided.
AI-generated descriptionA bare minimum HTML page.
See also React Starter.
MIT Licensed