Scatter Plot
Explore relationships between variables with scatter plots. Chart.ts renders dots as SVG elements with regression lines, cluster coloring, and Tailwind CSS styling. Perfect for data analysis and scientific visualization.
$
npm install @chartts/coreexample.tsx
import { scatter } from "@chartts/core"
const svg = scatter({
data: [
{ hours: 2, score: 65 },
{ hours: 4, score: 72 },
{ hours: 6, score: 80 },
{ hours: 8, score: 88 },
{ hours: 10, score: 92 },
{ hours: 12, score: 95 },
],
x: "hours",
y: "score",
trendLine: "linear",
})Features
Linear and polynomial regression lines
Cluster coloring by category
Tooltip with custom content
Axis labels and grid lines
SVG rendering for crisp display
Tailwind CSS on dots, lines, axes
Under 3kb tree-shaken