Constructors

Accessors

Methods

  • Choose bar spacing so barCount bars fit the width, anchored at the right edge.

    Parameters

    • barCount: number

    Returns void

  • Logical index → x (media px), bar center.

    Parameters

    • index: number

    Returns number

  • Pan by a pixel delta. Positive dx drags chart content to the right (revealing older bars), matching a natural left-button drag.

    Parameters

    • dx: number

    Returns void

  • Logical index of the latest bar; the right edge anchors to baseIndex+rightOffset.

    Parameters

    • index: number

    Returns void

  • Repaint hook injected by the host chart, fired after setVisibleLogicalRange.

    Parameters

    • fn: null | () => void

    Returns void

  • Set the visible logical range (best effort): pick a bar spacing so the span fills the width and anchor the right edge at range.to. Bar spacing is clamped to [min,max], so an extreme span lands at the nearest zoom. Fires the change handler so a host that mutates the scale directly still repaints.

    Parameters

    Returns void

  • x (media px) → fractional logical index.

    Parameters

    • x: number

    Returns number

  • Zoom around an anchor x (the cursor): change bar spacing by factor while keeping whatever logical index sits under focusX pinned there. factor > 1 zooms in (wider bars).

    Parameters

    • focusX: number
    • factor: number

    Returns void