Start
Getting started
Install @chartgpu/chartgpu, size a container, and call ChartGPU.create with at least one series. The playground on this page runs the same minimal line chart.
Install
The package name on npm is @chartgpu/chartgpu. Install with your package manager:
npm install @chartgpu/chartgpu
# or: pnpm add @chartgpu/chartgpu
# or: bun add @chartgpu/chartgpu
Minimal example
Create a sized container element, then pass options with at least one series. Line data can be [x, y] tuples.
import { ChartGPU } from '@chartgpu/chartgpu';
const container = document.getElementById('chart')!;
const chart = await ChartGPU.create(container, {
theme: 'dark',
series: [{
type: 'line',
data: [[0, 1], [1, 3], [2, 2], [3, 5], [4, 4]],
}],
});
// later
chart.dispose();
Browser support
Live GPU demos need WebGPU: Chrome or Edge 113+, Safari 18+. Firefox support depends on platform and flags. Feature-detect with 'gpu' in navigator and offer a non-GPU fallback UI when needed.
Next steps
- Look up ChartGPU.create and options & series in the API reference
- Browse the series guides and copy a fuller options object from an example that matches your chart type
- Read WebGPU charts for the rendering model
- See multi-chart dashboards for live multi-chart boards