Skip to content

Optional WebGL geometry rendering

Set chartOptions.rendererPolicy: 'webgl' to opt in. Standalone Charts and Pivot use the same owner and appearance control. Omission remains SVG; no size threshold silently enables a GPU. Existing category/series/data-point limits still apply; GPU selection does not raise them. The stress fixtures explicitly set limits: { maxCategories: count, maxSeries: 2000, maxDataPoints: count * 3 } for their known input shape. ChartRendererPolicy / PivotChartRendererPolicy include this value; the existing ChartSvgRendererPolicy aliases remain SVG-only.

await chart.update({ chartOptions: { rendererPolicy: 'webgl' } });
// Explicitly return to the compatible default:
await chart.update({ chartOptions: { rendererPolicy: 'svg' } });
Native familyAccepted policiesCPU fallback after GPU failure
groupedColumn, groupedBar, scattersvg, batched-svg, webglBatched SVG
heatmapsvg, webglExisting SVG heatmap buckets
Other families, including combination, line, polar and geographicExisting policies; webgl rejects atomicallyNo GPU port

This policy belongs to the native renderer. ECharts and custom adapters retain their own rendering contracts; this option does not enable WebGL in them.

Canonical CPU data, domains, navigation, clipping and inspection remain authoritative. Bars/scatter retain the batched geometry index and a bounded number of SVG paths, with no individual DOM node per observation. Arrow/Home/End inspection and Enter/Space activation resolve canonical raw data. Heatmaps retain existing bounded row/column bucket reduction: an aggregate bucket is inspection-only, while a single-source cell retains raw activation. A million input matrix cells does not mean a million GPU rectangles. Existing category/bar navigation, scatter numeric X/Y windows and heatmap row/column windows retain their semantics.

The following requests deterministically use individual SVG: authored datum or segment encodings (including an empty encoding), runtime datumStyle, elements or onRender, saved member/measure/value-map colors, color-channel binding, authored bar stack groups, derived series, synthetic aggregate categories, and selection or peer-highlight appearance. WebGL previews/sparklines and authored markOpacity other than 1 also use SVG. Clearing incompatible saved options restores eligibility; runtime options require recreating the renderer.

GPU geometry supports the existing basic rectangular/rounded bar and circular scatter marks, theme/palette fills, heatmap intensity/grid strokes and clipping. Named/custom CSS colors outside supported hex and numeric RGB/RGBA paint forms fall back to CPU paint. Per-item DOM selectors/listeners/classes and external per-datum CSS are unsupported. Select SVG when relying on them. Hover CSS/filter paint effects are not mirrored by GPU geometry. CPU tooltips, crosshair, keyboard focus and activation remain available; selection updates can trigger an SVG fallback and a full CPU repaint. Transitions remain immediate on this backend. GPU float precision, edge antialiasing and scatter alpha compositing can differ from SVG; pixel-identical output and SVG feature equivalence are not promised.

One WebGL2 context belongs to each active chart surface. The backing canvas follows actual size and device pixel ratio; plot clipping uses the same CPU bounds. GPU size limits, resource allocation, shader/draw errors and unavailable WebGL2/SSR use CPU SVG. A surface whose initial GPU probe fails stays on CPU through data updates; recreate it, or switch to SVG and back, to retry availability. Subpixel grouped bars use a floating-point coverage buffer to avoid rounding tiny marks to transparent. This additionally requires EXT_color_buffer_float and EXT_float_blend; unavailable extensions produce CPU fallback.

Context loss shows CPU geometry immediately. After webglcontextrestored, shaders, buffers and dense-bar coverage resources are recreated from the latest committed scene, including windows updated while the context was lost. Recovery follows the WEBGL_lose_context lifecycle. Resize reuses the context; switching backend or destroying the chart removes listeners, releases GPU resources and loses the old context. The model stores only the requested policy and existing data/windows, never a GPU context, canvas or callback. Hydration rechecks host GPU availability.

The SVG surface reports the effective data-chart-renderer-policy and optional data-chart-renderer-fallback. These diagnostics do not change the saved policy. Failures use reasons such as webgl-unavailable, webgl-context-lost, webgl-initialization, webgl-size-limit, webgl-float-coverage, webgl-draw, webgl-paint or webgl-empty-frame. Customization fallbacks report their existing reason (for example datum-style, runtime-customization or selection-style).

SVG, PNG and PDF exports reconstruct CPU SVG from the committed geometry and exclude GPU canvases, controls and transient focus. They never screenshot the GPU framebuffer. Bars/scatter export batched SVG; heatmaps export native SVG buckets. Raw data views and CSV retain their existing source/window semantics. SVG and raster exports can therefore differ at edges or overlapping translucent marks from the interactive GPU view; authored data and domains remain the same.

See performance protocol and results and verification. CPU preparation and semantic-index costs remain; selecting WebGL alone does not establish frame-rate, native GPU memory or million-observation performance parity.