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

    Class PriceLinePrimitive

    A 'top' z-tier Primitive: a full-width horizontal line at a fixed price with a right-axis label pill, optionally draggable. Built on the F4 framework; positions via viewport.priceToY so it stays correct under any price-scale mode (F1).

    Distinct from the HorizontalLine drawing tool — this is programmatic (created/updated by the host via a handle), not an interactive, undo/redo-tracked, persisted drawing.

    Implements

    Index

    Constructors

    Properties

    Accessors

    Methods

    Constructors

    Properties

    id: string

    Stable id used for detach and hit-test routing.

    zOrder: PrimitiveZOrder = 'top'

    Paint tier.

    Accessors

    Methods

    • 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

    • Optional pointer hit-test in CSS pixels. Used to route drags (e.g. a draggable price line). Return true if (x, y) lands on the primitive.

      Parameters

      • x: number
      • y: number
      • layout: ChartLayout
      • viewport: Viewport
      • tolerance: number = DRAWING_HIT_TOLERANCE_PX

      Returns boolean