Skip to content
EliteChart

drawOhlcvLegend

Documentation


Documentation / @elitechart/core / drawOhlcvLegend

code
function drawOhlcvLegend(
   paint, 
   vp, 
   bar, 
   style?): void;

Defined in: renderer/ohlcv-legend.ts:154

Render the OHLCV legend for the given bar. When bar === null, the function is a no-op (nothing to show).

Parameters

paint

Paint

vp

Viewport

bar

Bar | null

style?

OhlcvLegendStyle = DEFAULT_OHLCV_LEGEND_STYLE

Returns

void

Example

code
import { drawOhlcvLegend, nearestBar } from '@elitechart/core';
const t = viewport.xToTime(cursorX) as unknown as number;
drawOhlcvLegend(paint, viewport, nearestBar(bars, t));