snapToOhlc
Documentation / @elitechart/core / snapToOhlc
Defined in: magnet/magnet.ts:55
Snap a pointer (time, price) to the nearest OHLC value.
pixelDistance(priceA, priceB) converts a price delta to pixel
distance so the 'weak' threshold can be compared in screen space.
The chart passes a closure around its viewport.
Parameters
bars
readonly Bar[]
pointerTime
pointerPrice
mode
pixelDistance
(priceA, priceB) => number
snapPixels?
number = 10