Zero dependencies
Pure vanilla JavaScript with no external visualization framework required.
Lightweight by designDatum is a lightweight, layer-based visualization library for building rich, interactive charts with vanilla JavaScript.
npm i @psdpainter/datum-jsBuild expressive visualizations with a small, composable API and no external runtime dependencies.
Pure vanilla JavaScript with no external visualization framework required.
Lightweight by designCombine lines, areas, bars, dots, rulers and other layers inside a single visualization.
Explore layers →Crosshairs and tooltips provide coordinated context across composed data layers.
View documentation →Work directly with primitive arrays or map object properties to visualization dimensions.
Data options →Import only what you need with a modern, straightforward JavaScript API.
Built for modern browsersCommon statistical helpers live alongside the visualization API.
Explore statistics →A Datum chart is a collection of independent layers. Add the visual primitives you need and let them share the same coordinate system.
Demand peaks as generation fades. Five layers tell the story on one shared axis.
A blue gradient grounds the chart in hourly demand. Its filled silhouette makes the evening surge easy to spot while leaving the other series visible.
The blue line traces the same 24 readings as the area. Its crisp edge lets you compare demand precisely against generation and the forecast.
The green line shows supply climbing through the day and falling toward evening. Where it crosses demand, the balance shifts from surplus to shortfall.
The purple line adds an expected demand curve. Compare it with actual demand to see where the evening peak exceeds expectations.
A dashed orange ruler stays at 60 across all 24 hours. This shared reference makes it easy to see which series sit above or below the target.
// 24 hourly readings per series
Datum.chart({
target: '#chart',
datum: [
Datum.area(demand, {
fill: Color.Blue,
opacity: 0.18,
gradient: true
}),
Datum.line(demand, {
name: 'Demand',
stroke: Color.Blue
}),
Datum.line(generation, {
name: 'Generation',
stroke: Color.Green
}),
Datum.line(forecast, {
name: 'Forecast',
stroke: Color.Purple
}),
Datum.ruler([], {
value: 60,
stroke: Color.Orange,
dashed: true
})
]
});Install Datum and create your first visualization in a few lines of JavaScript.