The attached primitive, or null when hidden (for advanced read access).
True while the profile is attached.
Hide the profile and detach its primitive. Returns true if one was shown.
Update styling/binning of an already-shown profile in place and repaint. No-op when hidden. Cheaper than hide+show — reuses the attached primitive.
Show the volume profile (idempotent). On first call it attaches a fresh
primitive; a repeat call re-applies opts to the existing one and
repaints instead of stacking duplicates. The primitive pulls the visible
window through a closure on the host, so it tracks pan/zoom for free.
Optionalopts: VolumeProfileOptionsForce a repaint of the profile from the current visible window. Use after the chart's data changes without a pan/zoom (which would repaint anyway). No-op when hidden.
C4 public entry point. Overlays a horizontal VolumeProfilePrimitive (volume binned by price over the visible window) on a chart through the host's primitive framework. Constructed explicitly by the host (
new VolumeProfileController(chart)), which is exactly why volume profile adds nothing to the base bundle: the base chart never references this class.Usage:
The primitive reads the visible window live via
host.visibleCandleView(), so panning/zooming reshapes the profile automatically on the chart's own render cycle —update()is only needed to force a repaint after data arrives without user interaction.