Skip to content

Installation

bash
npm install chartgpu
# or
pnpm add chartgpu
# or
yarn add chartgpu

Then import in your project:

ts
import { Chart, CandlePanel } from 'chartgpu';

CDN

html
<script type="module">
  import { Chart, CandlePanel } from 'https://cdn.jsdelivr.net/npm/chartgpu/dist/chartgpu.es.js';
</script>

TypeScript

ChartGPU is written in TypeScript and ships its own types — no @types package needed.

ts
import type { Candle, Timeframe, ChartEvents } from 'chartgpu';

Browser Support

ChartGPU uses WebGPU for candle rendering. The 2D overlay (indicators, crosshair, axes) always works — only the GPU canvas requires WebGPU.

BrowserWebGPUVersion
Chrome113+
Edge113+
Safari18+
Firefox🚧Behind flag (Nightly)
Chrome Android121+

If WebGPU is unavailable, Renderer.init() returns false and CandlePanel gracefully skips GPU rendering. The rest of the chart (indicators, panels, crosshair) continues to work.

Vite / Bundler Config

No special config needed. ChartGPU ships as a standard ES module. The .wgsl shader is inlined as a string at build time.

If you're using a raw bundler without Vite, you may need to handle the .wgsl import manually:

ts
// Without Vite ?raw support — pass the shader string directly
import { Renderer } from 'chartgpu';

Vite handles this automatically.

Released under the MIT License.