Chainable color object: .brighten(n), .setOpacity(a), .toString().
palettes
Record<string, string[]>
Map of palette name → hex colors.
getPalette
getPalette(name: string) → string[]
Copy of a named palette (throws if unknown).
setTheme
setTheme(name: string) → void
Apply 'dark' | 'light' | 'nordic'.
SeriesRegistry.registerType
registerType(name, seriesClass) → void
Register a custom series type.
SeriesRegistry.getType
getType(name) → class | undefined
Look up a registered series class.
dateFormat tokens
Token
Output
Example
%Y
Four-digit year
2026
%m / %d
Zero-padded month / day
03 / 22
%H / %M / %S
Hours (24h) / minutes / seconds
14 / 05 / 09
%B / %A
Full month / weekday name
March / Sunday
Palettes & themes
20 built-in palettes: default, tableau10, d3classic, brewer, google, ocean, sunset, earth, forest, berry, corporate, minimal, nordic, darkMode, neon, pastel, soft, classic, tupi, monochrome. 18 themes (9 families, each in light and dark) set a background + palette, for example:
Theme
Background
Palette
dark
#1a1f24
monochrome
light
#ffffff
monochrome
nordic
#eceff4
nordic
importKatuChartsfrom'katucharts.js';import'katucharts.js/bio';// modules register their chart types on importKatuCharts.setTheme('dark');KatuCharts.setOptions({colors:KatuCharts.getPalette('sunset')});constchart=KatuCharts.chart('container',{series:[{type:'volcano',data:[/* … */]}]});
Instance — data & layout
Method
Signature → returns
Description
addSeries
addSeries(options, redraw=true) → BaseSeries
Append a series; redraw=false to batch.
get
get(id) → BaseSeries | Axis | undefined
Find a series or axis by id.
update
update(options, redraw=true) → void
Merge partial options (title, axes, series…).
addAxis
addAxis(options, isX=false, redraw=true) → Axis
Add an axis at runtime.
redraw
redraw() → void
Apply pending changes immediately.
animatedRedraw
animatedRedraw(duration=500) → void
Redraw with a transition.
reflow
reflow() → void
Recalculate layout for the current container size.
setSize
setSize(width, height) → void
Set pixel dimensions and redraw.
setTitle
setTitle(titleOptions?, subtitleOptions?) → void
Update title/subtitle; null removes.
Instance — export, data & UI
Method
Signature → returns
Description
getSVG
getSVG() → string
Standalone SVG markup.
getCSV
getCSV() → string
Data as CSV.
getTable
getTable() → string
Data as an HTML <table> string.
getDataRows
getDataRows() → array[][]
2-D array; first row is headers.
exportChart
exportChart({ type, filename, width, scale })
Download PNG/JPEG/SVG/PDF.
showLoading
showLoading(text='Loading...') → void
Show the loading overlay.
hideLoading
hideLoading() → void
Hide the loading overlay.
getSeriesInstances
getSeriesInstances() → BaseSeries[]
All series instances.
getXAxes / getYAxes
→ Axis[]
X / Y axis instances (multi-axis returns many).
destroy
destroy() → void
Remove from DOM and unbind listeners — call before removing the container.
chart.showLoading('Fetching data…');fetch('/api/data').then(r=>r.json()).then(data=>{chart.addSeries({data});chart.hideLoading();});chart.exportChart({type:'image/svg+xml',filename:'report',width:1200});// on teardownchart.destroy();
Plot renderer
chart.plotRenderer exposes low-level primitives for custom shapes and annotations in the plot area.