← All comparisons
Chart.ts vs D3.js
D3 is the gold standard for custom data visualizations. It is incredibly powerful but has a steep learning curve and requires building everything from primitives.
| Feature | Chart.ts | D3 |
|---|---|---|
| Bundle size | <15kb min+gzip (entire library) | ~30kb min+gzip (core) |
| Tree-shaking | Full (import only what you use) | Good (modular packages) |
| TypeScript | Built-in, strict mode, full inference | Community types |
| SSR | Native SSR, works with any framework | Requires jsdom or similar |
| Accessibility | WCAG AA, keyboard nav, screen readers, pattern fills | Manual implementation required |
| Tailwind CSS | Native className on every element, dark: variants | Manual (you build the DOM yourself) |
| Chart types | 65+ built-in (52 core + 13 WebGL/3D) | Unlimited (build your own) |
| Frameworks | React, Vue, Svelte, Solid, Angular, Vanilla JS | Framework-agnostic (manual DOM) |
| License | MIT | ISC |
| Rendering | Triple engine: SVG + Canvas + WebGL (auto-switching at 10k/100k points) | SVG or Canvas (manual) |
| Real-Time | Built-in streaming, WebSocket, SSE, HTTP polling via @chartts/websocket | Manual implementation |
| GPU / 3D | WebGL renderer + @chartts/gl with 13 3D chart types (Scatter3D, Surface3D, Globe3D, etc.) | No built-in WebGL |
| Financial | @chartts/finance: SMA, EMA, RSI, MACD, Bollinger Bands, ATR, VWAP, Sharpe ratio | No (separate libraries) |
| Plugins | defineChartType() with render context, hit testing, custom scales | N/A (toolkit) |
| Interactions | Zoom, pan, brush selection, crosshair, linked charts | Manual implementation |
| Advanced Charts | Sankey, treemap, sunburst, chord, geo maps, network graphs, 3D globe | Unlimited (build yourself) |
| Theme Presets | 34 presets (Nord, Dracula, Catppuccin, Tokyo Night, Material, etc.) | No presets |
Why switch from D3?
Chart.ts advantages
- 65+ ready-made charts vs build-from-scratch
- Minutes to first chart vs weeks with D3
- Built-in accessibility (WCAG AA)
- Native framework packages (React, Vue, etc.)
- Triple renderer auto-switches for performance
D3 limitations
- Steep learning curve, months to proficiency
- No pre-built chart components
- You build everything from primitives
- SSR requires jsdom workarounds
- Accessibility must be implemented manually
Ready to switch?
Get started with Chart.ts in 30 seconds.
$
npm install @chartts/core