Skip to content
EliteChart

normalizeCompareSeries

Documentation


Documentation / @elitechart/core / normalizeCompareSeries

code
function normalizeCompareSeries(
   compare, 
   primaryAnchorPrice, 
   primaryAnchorTime): readonly {
  price: Price;
  time: TimestampMs;
}[];

Defined in: compare/compare-types.ts:82

Given a compare series and the primary's anchor price + time, compute the normalized polyline points to render (in compare-series-bar order, skipping bars before the anchor window).

Parameters

compare

CompareSeries

primaryAnchorPrice

Price

primaryAnchorTime

TimestampMs

Returns

readonly { price: Price; time: TimestampMs; }[]

Example

code
import { normalizeCompareSeries } from '@elitechart/core';
const pts = normalizeCompareSeries(eth, primaryAnchorPrice, primaryAnchorTime);
for (const p of pts) paint.lineTo(vp.timeToX(p.time), vp.priceToY(p.price));