• Pure: compute a price range from data extremes plus top/bottom margins. Returns a padded [min,max]; widens a degenerate (flat) range so it's drawable.

    The margins are fractions of the pane height, so the data band occupies the 1 - marginTop - marginBottom left between them. Padding the data span by the margin instead — which is what this did — makes the reserved space depend on how tall the data happens to be: an overlay asking for 0.82 to sit in the bottom 18% got high + 0.82 * span, leaving its bars 55% of the pane. The difference only shows at large margins; at the 0.1 default the two readings land within a few percent of each other.

    Parameters

    • low: number
    • high: number
    • marginTop: number
    • marginBottom: number

    Returns PriceRange