Lightweight, data-driven chart library. Zero dependencies. Single <script> tag.
Monthly revenue, cost & profit — smooth curves, 3 series
czChart.create('#chart-line', {
type: 'line',
data: [...],
x: 'month',
y: ['revenue', 'cost', 'profit'],
series: { smooth: true, pointRadius: 3 }
});
Quarterly sales by region — tooltip aligned top
czChart.create('#chart-bar', {
type: 'bar',
data: [...],
x: 'quarter',
y: ['north', 'south', 'east'],
tooltip: { align: 'top' } // right, left, top, bottom, auto
});
Daily website traffic — 30 days, smooth gradient fill
czChart.create('#chart-area', {
type: 'area',
data: [...], // 30 data points
x: 'date',
y: ['pageviews', 'sessions'],
series: { smooth: true }
});
Market share — hover to explode, click legend to toggle
czChart.create('#chart-pie', {
type: 'pie',
data: [...],
x: 'browser',
y: 'share'
});
Expense breakdown — inner radius = 0.6
czChart.create('#chart-donut', {
type: 'donut',
data: [...],
x: 'category',
y: 'amount'
});
Height vs Weight — 60 random points
czChart.create('#chart-scatter', {
type: 'scatter',
data: scatterData,
x: 'height',
y: 'weight'
});
Skill comparison — multi-dataset overlay
czChart.create('#chart-radar', {
type: 'radar',
data: [...],
x: 'skill',
y: ['player_a', 'player_b']
});
Server response time (ms) — dark theme, area fill
czChart.create('#chart-dark', {
type: 'line',
theme: 'dark',
data: [...],
series: { smooth: true, fill: true, pointRadius: 4 }
});
Server CPU usage — semi-circle gauge with colored zones
czChart.create('#chart-gauge', {
type: 'gauge',
data: [{ label: 'CPU', value: 72 }],
x: 'label', y: 'value',
gauge: {
min: 0, max: 100,
zones: [
{ min: 0, max: 50, color: '#10b981' },
{ min: 50, max: 75, color: '#f59e0b' },
{ min: 75, max: 100, color: '#ef4444' }
]
}
});
Top programming languages — horizontal grouped bars
czChart.create('#chart-hbar', {
type: 'horizontalBar',
data: [...],
x: 'language',
y: ['popularity', 'jobs']
});
Stock price OHLC data — 20 trading days
czChart.create('#chart-candle', {
type: 'candlestick',
data: ohlcData,
x: 'date',
y: 'ohlc'
});
Sales pipeline conversion — top to bottom flow
czChart.create('#chart-funnel', {
type: 'funnel',
data: [...],
x: 'stage',
y: 'count'
});
Baby temperature monitoring — hourly over 1 week (°C)
czChart.create('#chart-heatmap', {
type: 'heatmap',
data: [...],
x: 'hour',
y: ['Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat', 'Sun'],
heatmap: {
colorScale: ['#3b82f6','#06b6d4','#10b981','#f59e0b','#ef4444']
}
});
Revenue breakdown — cumulative positive/negative changes
czChart.create('#chart-waterfall', {
type: 'waterfall',
data: [...],
x: 'item', y: 'amount'
});
GDP vs Life Expectancy — bubble size = population
czChart.create('#chart-bubble', {
type: 'bubble',
data: [...],
x: 'gdp', y: 'life_exp',
bubble: { sizeKey: 'population' }
});
Market cap — proportional nested rectangles
czChart.create('#chart-treemap', {
type: 'treemap',
data: [...],
x: 'sector', y: 'market_cap'
});
Test scores distribution — min, Q1, median, Q3, max per subject
czChart.create('#chart-boxplot', {
type: 'boxplot',
data: [...],
x: 'subject',
y: ['min','q1','median','q3','max']
});
Team skills — radial bar sectors
czChart.create('#chart-polar', {
type: 'polar',
data: [...],
x: 'skill', y: 'score'
});
Revenue as bars, profit as line, growth as smooth area — includes negative values crossing zero
czChart.create('#chart-mixed1', {
data: [...],
x: 'month',
y: ['revenue', 'profit', 'growth'],
types: {
revenue: 'bar',
profit: 'line',
growth: 'area-spline'
}
});
Two datasets with different rendering styles — straight area vs smooth area-spline
// c3.js-style types config
czChart.create('#chart-mixed2', {
data: [...],
types: {
data1: 'area',
data2: 'area-spline'
}
});
Two bar datasets grouped side-by-side with a smooth spline trend line overlaid
czChart.create('#chart-mixed3', {
data: [...],
types: {
online: 'bar',
store: 'bar',
total_trend: 'spline'
}
});
Load data from inline CSV string — auto-parsed
czChart.create('#chart-csv', {
type: 'bar',
data: "product,Q1,Q2,Q3,Q4\nLaptop,120,150,180,200\nPhone,200,180,220,260\nTablet,80,90,100,130"
});