Documentation / @ripl/charts / StockChart
Class: StockChart<TData> ​
Defined in: charts/src/charts/stock.ts:107
Candlestick (stock) chart rendering OHLC data with optional volume bars.
Each data point is rendered as a candlestick with a body (open-close range) and wick (high-low range), colored by direction. Supports an optional volume sub-chart, crosshair, tooltips, grid, and animated entry/update transitions.
Extends ​
Chart<StockChartOptions<TData>>
Type Parameters ​
| Type Parameter | Default type | Description |
|---|---|---|
TData | unknown | The type of each data item in the dataset. |
Constructors ​
Constructor ​
new StockChart<
TData>(target,options):StockChart<TData>
Defined in: charts/src/charts/stock.ts:120
Parameters ​
| Parameter | Type |
|---|---|
target | string | Context<Element, Record<string, unknown>> | HTMLElement |
options | StockChartOptions<TData> |
Returns ​
StockChart<TData>
Overrides ​
Properties ​
| Property | Modifier | Type | Inherited from | Defined in |
|---|---|---|---|---|
animationOptions | protected | ChartAnimationOptions | Chart.animationOptions | charts/src/core/chart.ts:72 |
autoRender | protected | boolean | Chart.autoRender | charts/src/core/chart.ts:71 |
colorGenerator | protected | Generator<string, string, any> | Chart.colorGenerator | charts/src/core/chart.ts:78 |
options | protected | StockChartOptions | Chart.options | charts/src/core/chart.ts:77 |
parent? | public | EventBus<EventMap> | Chart.parent | core/src/core/event-bus.ts:79 |
renderer | protected | Renderer | Chart.renderer | charts/src/core/chart.ts:70 |
scene | protected | Scene | Chart.scene | charts/src/core/chart.ts:69 |
titleOptions? | protected | ChartTitleOptions | Chart.titleOptions | charts/src/core/chart.ts:73 |
defaultKey | readonly | typeof defaultKey | Chart.defaultKey | core/src/core/disposer.ts:10 |
Methods ​
destroy() ​
destroy():
void
Defined in: charts/src/core/chart.ts:195
Destroys the chart, its scene, context, and cleans up all event subscriptions.
Returns ​
void
Inherited from ​
dispose() ​
protecteddispose(key?):void
Defined in: core/src/core/disposer.ts:24
Disposes all resources under the given key, or all resources if no key is provided.
Parameters ​
| Parameter | Type |
|---|---|
key? | PropertyKey |
Returns ​
void
Inherited from ​
emit() ​
Call Signature ​
emit<
TEvent>(event):TEvent
Defined in: core/src/core/event-bus.ts:127
Emits an event, invoking all matching handlers and bubbling to the parent if applicable.
Type Parameters ​
| Type Parameter | Default type |
|---|---|
TEvent extends Event<undefined> | Event<undefined> |
Parameters ​
| Parameter | Type |
|---|---|
event | TEvent |
Returns ​
TEvent
Inherited from ​
Call Signature ​
Defined in: core/src/core/event-bus.ts:128
Emits an event, invoking all matching handlers and bubbling to the parent if applicable.
Type Parameters ​
| Type Parameter |
|---|
TEvent extends keyof EventMap |
Parameters ​
| Parameter | Type |
|---|---|
type | TEvent |
data | EventMap[TEvent] |
Returns ​
Inherited from ​
getAnimationDuration() ​
protectedgetAnimationDuration(referenceDuration?):number
Defined in: charts/src/core/chart.ts:132
Parameters ​
| Parameter | Type | Default value |
|---|---|---|
referenceDuration | number | 1000 |
Returns ​
number
Inherited from ​
getChartArea() ​
protectedgetChartArea():ChartArea
Defined in: charts/src/core/chart.ts:163
Returns ​
Inherited from ​
getPadding() ​
protectedgetPadding():ChartPadding
Defined in: charts/src/core/chart.ts:153
Returns ​
Inherited from ​
getSeriesColor() ​
protectedgetSeriesColor(seriesId):string
Defined in: charts/src/core/chart.ts:190
Parameters ​
| Parameter | Type |
|---|---|
seriesId | string |
Returns ​
string
Inherited from ​
has() ​
has(
type):boolean
Defined in: core/src/core/event-bus.ts:84
Returns whether there are any listeners registered for the given event type.
Parameters ​
| Parameter | Type |
|---|---|
type | keyof EventMap |
Returns ​
boolean
Inherited from ​
init() ​
protectedinit():void
Defined in: charts/src/core/chart.ts:100
Returns ​
void
Inherited from ​
off() ​
off<
TEvent>(type,handler):void
Defined in: core/src/core/event-bus.ts:102
Removes a previously registered handler for the given event type.
Type Parameters ​
| Type Parameter |
|---|
TEvent extends keyof EventMap |
Parameters ​
| Parameter | Type |
|---|---|
type | TEvent |
handler | EventHandler<EventMap[TEvent]> |
Returns ​
void
Inherited from ​
on() ​
on<
TEvent>(type,handler,options?):Disposable
Defined in: core/src/core/event-bus.ts:89
Subscribes a handler to the given event type and returns a disposable for cleanup.
Type Parameters ​
| Type Parameter |
|---|
TEvent extends keyof EventMap |
Parameters ​
| Parameter | Type |
|---|---|
type | TEvent |
handler | EventHandler<EventMap[TEvent]> |
options? | EventSubscriptionOptions |
Returns ​
Inherited from ​
once() ​
once<
TEvent>(type,handler,options?):Disposable
Defined in: core/src/core/event-bus.ts:117
Subscribes a handler that is automatically removed after it fires once.
Type Parameters ​
| Type Parameter |
|---|
TEvent extends keyof EventMap |
Parameters ​
| Parameter | Type |
|---|---|
type | TEvent |
handler | EventHandler<EventMap[TEvent]> |
options? | EventSubscriptionOptions |
Returns ​
Inherited from ​
render() ​
render():
Promise<void>
Defined in: charts/src/charts/stock.ts:583
Returns ​
Promise<void>
Overrides ​
resolveSeriesColors() ​
protectedresolveSeriesColors(series):void
Defined in: charts/src/core/chart.ts:175
Parameters ​
| Parameter | Type |
|---|---|
series | object[] |
Returns ​
void
Inherited from ​
retain() ​
protectedretain(value,key?):void
Defined in: core/src/core/disposer.ts:13
Registers a disposable resource under an optional key for later cleanup.
Parameters ​
| Parameter | Type | Default value |
|---|---|---|
value | Disposable | undefined |
key | PropertyKey | Disposer.defaultKey |
Returns ​
void
Inherited from ​
update() ​
update(
options):void
Defined in: charts/src/core/chart.ts:113
Merges partial options into the current options and re-renders if autoRender is enabled.
Parameters ​
| Parameter | Type |
|---|---|
options | Partial<TOptions> |
Returns ​
void