Documentation menu

Class

ChartPool

Charts that share one GPU device (r25). Make one with FerroChart.createPool, then charts with pool.create(canvas, options).

Properties

renderer

readonly renderer: 'webgpu' | 'webgl2';

The GPU API the pool uses: 'webgpu' or 'webgl2'.

size

readonly size: number;

Number of charts alive in the pool.

Methods

create

create(canvas: HTMLCanvasElement, options?: ChartCreateOptions): Promise<FerroChart>;

A chart in this pool, with the options of FerroChart.create (renderer is the pool's). On WebGL2 the canvas gets a 2D context, so it must not have another one yet.

destroy

destroy(): void;

Destroys every chart of the pool and releases the device. Charts made from it can no longer be used.

Like every object of the API, a ChartPool holds WebAssembly memory. Objects returned by the chart are freed with it; free() (or using) releases one earlier.