@rekurt/openkline - v0.2.0
    Preparing search index...

    Class VolumeProfilePrimitive

    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 to volume / 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 getView closure (the controller wires this to engine.visibleCandleView()), so it always reflects the current pan/zoom without importing the buffer. The price range comes from viewport.priceMin/priceMax, and each bin's mid-price maps to Y via viewport.priceToY — inheriting price-scale-mode correctness. Self-clips to the chart area. Stable id volume-profile.

    Implements

    Index

    Constructors

    Properties

    Accessors

    Methods

    Constructors

    Properties

    id: "volume-profile" = 'volume-profile'

    Stable id used for detach and hit-test routing.

    zOrder: PrimitiveZOrder = 'bottom'

    Paint tier.

    Accessors

    Methods

    • 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).

      Parameters

      Returns VolumeProfile | null

    • 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.

      Parameters

      Returns void