Ultra-lightweight canvas charting library
The modern Chart.js alternative • Under 10kb • Zero dependencies • Pure Canvas API
npm install chartie
import { Chartie } from 'chartie';
const config = {
type: 'bar',
data: {
labels: ['Jan', 'Feb', 'Mar'],
datasets: [{
label: 'Sales',
data: [12, 19, 3],
backgroundColor: '#6366f1'
}]
}
};
const chart = new Chartie('myCanvas', config);
import { Chartie } from 'chartie';
import { useEffect, useRef } from 'react';
function MyChart({ config }) {
const canvasRef = useRef(null);
useEffect(() => {
const chart = new Chartie(canvasRef.current, config);
return () => chart.destroy();
}, [config]);
return <canvas ref={canvasRef} width={400} height={300} />;
}
Bar, Line, Pie, Doughnut, Area, and Scatter charts
Under 10kb bundle size with zero dependencies
Pure Canvas API for optimal rendering speed
Beautiful animations with multiple easing functions
Built-in responsive and retina display support
Full TypeScript support with complete type definitions
{
"type": "bar",
"data": {
"labels": [
"Jan",
"Feb",
"Mar",
"Apr",
"May",
"Jun"
],
"datasets": [
{
"label": "Revenue",
"data": [
120,
190,
300,
500,
200,
300
],
"backgroundColor": "#6366f1",
"borderColor": "#4f46e5",
"borderWidth": 1
},
{
"label": "Profit",
"data": [
80,
120,
200,
350,
150,
220
],
"backgroundColor": "#06b6d4",
"borderColor": "#0891b2",
"borderWidth": 1
}
]
},
"options": {
"responsive": true,
"animation": {
"duration": 1200,
"easing": "easeInOut"
}
}
}