Ced Charts

Chart Showcase

3-argument API. Zero dependencies. ~13KB gzip.

ced.chart(el, data, keys) — SVG rendering, synced crosshair, legend toggle, auto SI formatting.

Explore GitHub
Time-Series

Line Charts

The default chart type. Pass an array of keys to plot multiple series with auto-detected time axis.

ced.chart('#basic', data, ['indoor', 'outdoor'])
Dual Y-axis + dashed outdoor + fill indoor + reference line
Smooth cardinal spline interpolation
Filled

Area Charts

Area with unit and reference mark
Stacked area (energy breakdown)
Categorical

Bar Charts

Monthly energy bar chart
Stacked bar (monthly breakdown)
Correlation

Scatter Charts

Energy signature: heating vs outdoor temp
Distribution

Pie & Donut

Pie chart
Donut chart
Crosshair Sync

Synced Dashboard

Hover either chart to see crosshair and tooltip sync across both via group: 'demo'.

Temperature (synced)
Power (synced)
Reference

API

Signature

const c = ced.chart(container, data, keys_or_opts)
c.update(newData)   // swap data, re-render
c.resize()          // force re-layout
c.destroy()         // cleanup

Options

OptionTypeDefaultDescription
keysstring[][]Data keys to plot
typestring'line'line, area, bar, scatter, pie, donut
unitstring''Left Y-axis unit
rightstring[][]Keys on right Y-axis
rightUnitstring''Right Y-axis unit
heightnumber300Chart height in px
marknumberSingle reference line
marksobject[][]Multiple reference lines/bands
dashstring[][]Dashed line series
fillstring[][]Area fill below line
smoothbooleanfalseCardinal spline interpolation
stackedbooleanfalseStack bar/area series
groupstringnullCrosshair sync group
colorsobject{}Palette index per key
rangebooleanfalseDate range selector
fmtfunctionauto SICustom Y-axis formatter

Auto-Detection

  • X-axis: numeric >1e9 = time, string = category
  • Time format: <24h = HH:mm, <7d = ddd HH:mm, >7d = MM-DD
  • Y-axis: Heckbert nice numbers, auto SI suffixes (K/M/G)
  • Colors: palette --ch-1..--ch-12 by key order
  • Resize: ResizeObserver, debounced 150ms
  • Renderer: SVG for <50 keys, Canvas hybrid for 50+
CEDUIX v1.3 · 96 tokens · Inter only · MIT