charton API / @chart-on/core / index / computeSeasonality
Function: computeSeasonality()
computeSeasonality(
bars,options?,zone?):SeasonalData
Defined in: packages/core/src/seasonality/math.ts:169
Lay each year's closes over a shared window: the path per year, normalised, and optionally the mean or median path with the range of the years. Bars are daily and in time order; their date is read in zone. O(bars + years × slots).
Calendar alignment puts every date at the same position each year, on a leap-year calendar: 29 February only has a value in leap years (with gaps: 'carry' other years repeat 28 February's close there), and later dates line up across leap and common years. Trading alignment counts the window's bars instead, so the nth trading day of each year lines up.
Parameters
bars
readonly Bar[]
options?
Partial<SeasonalOptions> = {}
zone?
Zone = UTC