Optionalopts: VolumeProfileOptionsReadonlyidStable id used for detach and hit-test routing.
Paint tier.
The most recent options (read-only snapshot).
Compute the profile that would be drawn for the current visible window —
exposed for hosts that want the POC / value-area numbers (e.g. to label
them) without scraping the canvas. Returns null when there's nothing to
profile (no view, empty window, or a degenerate price range).
Paint the primitive. Should self-clip if it must stay inside the chart.
priceFormat is the chart's host-supplied price formatter (from
ChartConfig.priceFormat), so primitives that render a price label
(e.g. price lines) match the axis/crosshair formatting instead of
falling back to the library default.
Merge new options in place (e.g. switch side, recolor) without re-attaching.
A
'bottom'z-tier Primitive that paints a horizontal Volume Profile of the visible window: volume binned by price (see computeVolumeProfile) drawn as horizontal bars anchored to one chart edge, bar length proportional tovolume / maxVolume. POC and value-area bars get distinct fills; the bars sit BEHIND the grid and series (semi-transparent) so they read as a backdrop.The primitive owns no data — it pulls the visible candles each frame through a
getViewclosure (the controller wires this toengine.visibleCandleView()), so it always reflects the current pan/zoom without importing the buffer. The price range comes fromviewport.priceMin/priceMax, and each bin's mid-price maps to Y viaviewport.priceToY— inheriting price-scale-mode correctness. Self-clips to the chart area. Stable idvolume-profile.