Skip to content

Type Alias: OhlcTrace ​

ts
type OhlcTrace = Omit<CommonTraceAttributes, 'hoverlabel'> & CartesianTraceAttributes & object;

OHLC: the open, high, low and close of each period as a vertical line from low to high with an open tick on the left and a close tick on the right, colored by direction.

Type Declaration ​

NameTypeDescription
close?DataColumnThe close price of each period, in y-axis data units.
decreasing?OhlcTraceDecreasingStyle of falling bars: bars whose close is below their open (an unchanged bar compares its close with the previous close).
high?DataColumnThe high price of each period, in y-axis data units.
hoverlabel?OhlcTraceHoverlabelHover label style for this trace. Unset fields fall back to layout.hoverlabel (so there are no trace-level defaults).
increasing?OhlcTraceIncreasingStyle of rising bars: bars whose close is above their open (an unchanged bar compares its close with the previous close).
line?OhlcTraceLineLine style of every bar.
low?DataColumnThe low price of each period, in y-axis data units.
open?DataColumnThe open price of each period, in y-axis data units.
text?PerPoint<string | number>Hover text: one string for every bar, or one per bar. hovertext wins.
tickwidth?numberLength of the open (left) and close (right) ticks, as a fraction of the smallest x spacing between bars of the ohlc traces of the subplot. Range: 0 – 0.5
type"ohlc"Trace type.
x?DataColumnx coordinate of each bar (usually dates). Default: 0, 1, 2, …
xhoverformat?stringd3 number or date format of x values in hover labels. Default: the axis format.
xperiod?unknownOnly on date or linear x axes: snap each x value to its period of this length (ms, or 'M<n>' months on date axes), positioned per xperiodalignment.
xperiod0?unknownA period boundary for xperiod. Default: 2000-01-01 on date axes (a Sunday for weekly periods), 0 otherwise.
xperiodalignment?"start" | "middle" | "end"Where points sit within their xperiod.
yhoverformat?stringd3 number or date format of the prices in hover labels. Default: the y axis format.
zorder?numberStacking order among the traces of a subplot: higher is drawn on top. At equal zorder, financial traces draw above bars and boxes and below scatter traces (Plotly’s layer order), then in trace order.

Released under the MIT License.