Beautiful charts for modern web apps. Lightweight, fast, and developer-friendly.
π Now stable at 1.0 Β· chartlite.dev β for live demos and docs.
Chartlite is designed for developers who want beautiful, performant charts without the bloat.
Modern charting libraries are powerful but heavy:
- Recharts: ~400KB (with D3 dependencies)
- Chart.js: ~200KB
- ECharts: ~1MB (full build)
For a simple landing page or blog post, this is overkill.
Chartlite gives you professional charts at 10-15x smaller bundle size:
- β ~15KB gzipped - Enforced by CI
- β Zero dependencies - No D3, no bloat
- β TypeScript-first - Full type safety
- β Multiple data formats - Maximum flexibility
- β Accessible by default - WCAG-minded ARIA + keyboard navigation
- β Beautiful defaults - Inspired by Tailwind, Material, Nord
npm install @chartlite/core
# or
pnpm add @chartlite/core
# or
yarn add @chartlite/coreUsing a framework? Install the matching wrapper instead β each exposes all 8 charts:
npm install @chartlite/react # React
npm install @chartlite/vue # Vue 3
npm install @chartlite/svelte # Svelte
npm install @chartlite/element # <chart-lite> web component (any framework / none)import { LineChart } from '@chartlite/core';
new LineChart('#chart', {
data: [
{ x: 'Jan', y: 4200 },
{ x: 'Feb', y: 4800 },
{ x: 'Mar', y: 5200 }
],
curve: 'smooth',
theme: 'default'
}).render();That's it! Your chart is ready.
- Line Chart - Perfect for trends over time (linear & smooth)
- Bar Chart - Great for comparisons (vertical & horizontal, grouped & stacked)
- Area Chart - Beautiful filled visualizations (gradient & stacked)
- Scatter Chart - Correlations and distributions
- Pie / Donut Chart - Part-to-whole breakdowns
- Radial Chart - Progress rings and gauges
- Combo Chart - Bars plus a trend line/area on shared axes
- Sparkline - Tiny, axis-less inline metrics
Plus multi-series support, reference lines, annotations, and region highlighting across chart types β all eight rendering identically in the browser, on the server, and through every framework wrapper.
theme: 'default' // Clean, professional (Tailwind-inspired)
theme: 'midnight' // Dark mode
theme: 'minimal' // Black & white, print-ready
theme: 'tailwind' // Tailwind CSS colors
theme: 'nord' // Nord color palette (dark)
theme: 'high-contrast' // Maximum contrast (accessibility)
theme: 'material' // Material Design 3 (coming soon)Chartlite accepts data in multiple formats:
// 1. Classic DataPoint[] format
data: [{ x: 'Jan', y: 30 }, { x: 'Feb', y: 45 }]
// 2. Simple arrays (auto-generates x values)
data: [30, 45, 38, 52, 60]
// 3. Column-oriented (DataFrame style)
data: {
x: ['Q1', 'Q2', 'Q3', 'Q4'],
y: [45000, 52000, 48000, 61000]
}
// 4. Series-first (Ant Design style)
data: {
series: [{ name: 'Revenue', dataKey: 'revenue', color: '#3b82f6' }],
data: [
{ month: 'Jan', revenue: 4200 },
{ month: 'Feb', revenue: 4800 }
]
}
// 5. Row objects (first text field is x, each numeric field becomes a series)
data: [
{ month: 'Jan', revenue: 4200, costs: 2800 },
{ month: 'Feb', revenue: 4800, costs: 3200 }
]A legend appears automatically once there are two or more series (or pie slices /
radial rings); legend: false hides it.
- Target: 500-2,000 data points
- Render time: <16ms (60fps)
- Bundle size: ~15KB gzipped (~56KB minified), zero dependencies
- Built in: automatic downsampling (
maxPoints, default 500;0disables) and SVG-root reuse for fast updates
- Better defaults: "nice" axis ticks (line and scatter no longer force zero), crowded labels thinned or truncated, automatic legend for 2+ series, point markers only when each series has β€24 points, monotone
smoothcurves - Easier input: row-object data (a 5th format),
legend: true | false,maxPoints,xFormatter,chart.update(data, options?), sparklinevariant - Smoother interactivity: the tooltip snaps to the nearest x on line/area/combo and lists every series, follows keyboard focus, and stays in the viewport;
legendToggle()works on pie and radial legends - Wrappers: a
tooltipprop/attribute, in-place data updates, stable callbacks, and ref access - Fix:
responsivedefaults totruefor every chart type
- 8 chart types: Line, Bar (grouped/stacked), Area (gradient/stacked), Scatter, Pie/Donut, Radial/gauge, Combo, Sparkline
- Multi-series support with auto-color assignment and a configurable legend
- Annotations, reference lines & region highlighting
- Accessibility: ARIA roles/descriptions, keyboard navigation, screen-reader data-table fallback (WCAG 2.1 AA)
- Interactivity (opt-in, tree-shakeable): tooltips, crosshair, legend toggle, click/hover callbacks
- Server-side / zero-JS rendering (
renderToString) + a declarative chart spec - Agent-native tooling:
@chartlite/mcpserver, published JSON Schema, andllms.txt - CSS-variable theming (
cssVars) & pluggable formatters (currency/percent/abbreviate) - Performance: automatic downsampling + SVG-root reuse for fast updates
- 4 flexible data formats Β· 6 built-in themes Β· responsive sizing Β· SVG export Β· TypeScript-first
- Official wrappers for React, Vue, Svelte + a
<chart-lite>web component
- More design-system themes (Material 3, GitHub)
- An Angular wrapper
- Additional chart types as demand warrants
The road to 1.0 is archived in V1_ROADMAP.md.
import { LineChart } from '@chartlite/react';
function App() {
return (
<LineChart
data={monthlyRevenue}
curve="smooth"
theme="tailwind"
/>
);
}<div id="my-chart"></div>
<script type="module">
import { BarChart } from '@chartlite/core';
new BarChart('#my-chart', {
data: {
x: ['Product A', 'Product B', 'Product C'],
y: [120, 280, 190]
},
orientation: 'horizontal'
}).render();
</script>import { renderToString } from '@chartlite/core/server';
// Runs in Node/Bun/edge β no browser, no jsdom. Drop the string straight into HTML.
const svg = renderToString({ type: 'line', data: [1, 2, 3], theme: 'tailwind' });The object passed to renderToString is a ChartSpec β the same shape the
@chartlite/mcp server's render_chart tool accepts, described by a
published JSON Schema. AI agents and your server build charts the exact same way.
More examples at examples/ Β· live at chartlite.dev
| Feature | Chartlite | Recharts | Chart.js | ECharts |
|---|---|---|---|---|
| Bundle Size | ~15KB gz | ~400KB | ~200KB | ~1000KB |
| Dependencies | 0 | D3 (many) | 0 | ZRender |
| TypeScript | Native | Good | Good | Good |
| Chart Types | 8 | 10+ | 8+ | 50+ |
| Data Formats | 5 | 1 | 1 | 2 |
| Learning Curve | Low | Medium | Low | High |
| Best For | Fast pages | React apps | Simple charts | Dashboards |
- Landing pages with live metrics
- Blog posts with data visualization
- Documentation with charts
- Marketing sites (fast page loads critical)
- Simple internal dashboards
- Projects where bundle size matters
- Real-time monitoring dashboards
- Complex data exploration tools
- Applications with millions of data points
- Projects needing 50+ chart types
- Advanced filtering/zooming requirements
For those use cases, we recommend Apache ECharts or Recharts.
We deliberately trade feature breadth for:
- Performance - 5-10x faster rendering
- Bundle size - 10-15x smaller
- Developer Experience - Simple, TypeScript-first API
- Zero Dependencies - No supply chain risk
- Beautiful by Default - Professional themes, no config needed
- Developer Experience First - TypeScript, flexible data formats
- Performance Conscious - 15KB Gzip budget with automatic point sampling
- Accessibility Non-Negotiable - WCAG 2.1 AA compliant
- Progressive Enhancement - Optional features are truly optional
We welcome contributions! See CONTRIBUTING.md for guidelines.
Priority areas:
- Design system themes (Material 3, GitHub)
- Accessibility improvements
- Documentation and examples
- An Angular wrapper (React, Vue, Svelte, and the web component are shipped)
MIT Β© Riel St. Amand
Inspired by the best:
- Apache ECharts - For beautiful defaults and declarative API
- SciChart - For professional themes and performance
- Recharts - For React-friendly composability
- Tailwind CSS - For color systems and design tokens
Made with β€οΈ for developers who care about performance