Options
All
  • Public
  • Public/Protected
  • All
Menu

OhlcDataSeries is a DataSeries for holding Open, High, Low, Close data in SciChart's JavaScript Stock Charts

remarks

The OhlcDataSeries is primarily used with the JavaScript Candlestick Chart but can also be used with our JavaScript Ohlc Chart, used for drawing JavaScript Stock Charts and Candlestick or OHLC charts.

A DataSeries stores the data to render. This is independent from the RenderableSeries which defines how that data should be rendered.

See derived types of BaseDataSeries to find out what data-series are available. See derived types of IRenderableSeries to find out what 2D JavaScript Chart types are available.

Hierarchy

Implements

Index

Constructors

constructor

Properties

Readonly dataChanged

dataChanged: EventHandler<IDataChangeArgs> = new EventHandler<IDataChangeArgs>()

An EventHandler which is raised when the data changes.

remarks

To subscribe to dataChanged, use the following code:

const dataSeries = new XyDataSeries(wasmContext);
const callback = () => {
   // Data has changed
};
dataSeries.dataChanged.subscribe(callback);

To unsubscribe from dataChanged, use the following code:

const dataSeries = new XyDataSeries(wasmContext);
dataSeries.dataChanged.unsubscribe(callback);

Readonly dataDistributionCalculator

dataDistributionCalculator: IDataDistributionCalculator = new DataDistributionCalculator()

Gets the IDataDistributionCalculator instance for this DataSeries. Used when resampling data to determine the correct algorithm

dataIds

dataIds: Record<number | string, number[]>

If set, these will be included in the serialised definition, so that it can be used with sharedData

highFinalAnimationValues

highFinalAnimationValues: SCRTDoubleVector

High vector with final animation values

highInitialAnimationValues

highInitialAnimationValues: SCRTDoubleVector

High vector with initial animation values

Readonly id

id: string

A unique Id for the IDataSeries

Protected indexes

indexes: SCRTDoubleVector

Protected isDeleted

isDeleted: boolean

lowFinalAnimationValues

lowFinalAnimationValues: SCRTDoubleVector

Low vector with final animation values

lowInitialAnimationValues

lowInitialAnimationValues: SCRTDoubleVector

Low vector with initial animation values

minXSpacing

minXSpacing: number = 0

openFinalAnimationValues

openFinalAnimationValues: SCRTDoubleVector

Open vector with final animation values

openInitialAnimationValues

openInitialAnimationValues: SCRTDoubleVector

Open vector with initial animation values

Readonly type

type: Ohlc = EDataSeriesType.Ohlc

Gets the EDataSeriesType type of the DataSeries

Readonly webAssemblyContext

webAssemblyContext: TSciChart

The {@link TSciChart | SciChart WebAssembly Context} containing native methods and access to our WebGL2 Engine

xFinalAnimationValues

xFinalAnimationValues: SCRTDoubleVector

X vector with final animation values

xInitialAnimationValues

xInitialAnimationValues: SCRTDoubleVector

X vector with initial animation values

Protected xValues

xValues: SCRTDoubleVector

yFinalAnimationValues

yFinalAnimationValues: SCRTDoubleVector

Y vector with final animation values

yInitialAnimationValues

yInitialAnimationValues: SCRTDoubleVector

Y vector with initial animation values

Protected yValues

yValues: SCRTDoubleVector

Accessors

changeCount

  • get changeCount(): number
  • Gets the change count for this data series. Allows to indentify when data series was changed

    inheritdoc

    Returns number

containsNaN

  • get containsNaN(): boolean
  • set containsNaN(containsNaN: boolean): void
  • Gets or sets whether the Y data contains NaN values. Set containsNaN = false for the performance optimization when the series has no NaNs

    inheritdoc

    Returns boolean

  • Gets or sets whether the Y data contains NaN values. Set containsNaN = false for the performance optimization when the series has no NaNs

    inheritdoc

    Parameters

    • containsNaN: boolean

    Returns void

dataSeriesName

  • get dataSeriesName(): string
  • set dataSeriesName(dataSeriesName: string): void
  • Gets the DataSeries name. This is used in legend controls and tooltips to identify the series

    inheritdoc

    Returns string

  • Gets the DataSeries name. This is used in legend controls and tooltips to identify the series

    inheritdoc

    Parameters

    • dataSeriesName: string

    Returns void

hasValues

  • get hasValues(): boolean
  • When true, the DataSeries has values, else it is empty

    inheritdoc

    Returns boolean

isEvenlySpaced

  • get isEvenlySpaced(): boolean
  • set isEvenlySpaced(isSorted: boolean): void

isSorted

  • get isSorted(): boolean
  • set isSorted(isSorted: boolean): void
  • Gets or sets whether the X-values are sorted ascending or not. See remarks at IDataSeries.isSorted for further information

    inheritdoc

    Returns boolean

  • Gets or sets whether the X-values are sorted ascending or not. See remarks at IDataSeries.isSorted for further information

    inheritdoc

    Parameters

    • isSorted: boolean

    Returns void

xRange

  • Gets the range in the X-direction for this DataSeries

    inheritdoc

    Returns NumberRange

Methods

append

  • append(x: number, open: number, high: number, low: number, close: number, metadata?: IPointMetadata): void
  • Appends a single X (Date), Open, High, Low, Close point to the DataSeries

    remarks

    For best performance on drawing large datasets, use the appendRange method X-value is a Date, encoded as a Unix Timestamp.

    Any changes of the DataSeries will trigger a redraw on the parent SciChartSurface

    Parameters

    • x: number

      X-value is a Date, encoded as a Unix Timestamp.

    • open: number

      The Open value for this OHLC bar

    • high: number

      The High value for this OHLC bar

    • low: number

      The Low value for this OHLC bar

    • close: number

      The Close value for this OHLC bar

    • Optional metadata: IPointMetadata

      The point metadata

    Returns void

Protected appendMetadata

Protected appendMetadataRange

  • appendMetadataRange(metadata: IPointMetadata[], length: number): void

appendRange

  • Appends arrays of X (Date), Open, High, Low, Close point to the DataSeries

    remarks

    This method is considerably higher performance than append which appends a single point X-value is a Date, encoded as a Unix Timestamp.

    Any changes of the DataSeries will trigger a redraw on the parent SciChartSurface

    Parameters

    • xValues: NumberArray

      X-values are Dates, encoded as a Unix Timestamp.

    • openValues: NumberArray

      The Open values for this OHLC bar

    • highValues: NumberArray

      The High values for this OHLC bar

    • lowValues: NumberArray

      The Low values for this OHLC bar

    • closeValues: NumberArray

      The Close value sfor this OHLC bar

    • Optional metadata: IPointMetadata[]

      The array of point metadata

    Returns void

clear

  • clear(): void
  • Clears the entire DataSeries.

    remarks

    Note this does not free memory, WebAssembly/Native memory is released by calling delete, after which the DataSeries is no longer usable.

    Any changes of the DataSeries will trigger a redraw on the parent SciChartSurface

    Returns void

count

  • count(): number
  • Gets the count of data-points in the DataSeries

    Returns number

delete

  • delete(): void
  • Deletes native (WebAssembly) memory used by this type, after which it cannot be used.

    remarks

    Call .delete() before finishing with the object to ensure that WebAssmembly memory leaks do not occur.

    All elements within SciChart's High Performance Realtime JavaScript Charts which implement IDeletable must be deleted manually to free native (WebAssembly) memory

    Returns void

getIndicesRange

  • Gets the integer indices of the XValues array that are currently in the VisibleRange passed in, and an undefined range otherwise.

    Parameters

    • xRange: NumberRange

      The VisibleRange to get the indices range

    • Default value isCategoryData: boolean = false

      If True the renderable series uses CategoryAxis

    • Default value downSearchMode: ESearchMode = ESearchMode.RoundDown

      Specifies the search mode used to look for the index of visibleRange.Min

    • Default value upSearchMode: ESearchMode = ESearchMode.RoundUp

      Specifies the search mode used to look for the index of visibleRange.Max

    Returns NumberRange

    numberRange The indices to the X-Data that are currently in range.

getIsDeleted

  • getIsDeleted(): boolean

getMetadataAt

getMetadataLength

  • getMetadataLength(): number

getNativeCloseValues

  • getNativeCloseValues(): SCRTDoubleVector
  • Gets a native / WebAssembly vector of Close-values in the DataSeries

    Returns SCRTDoubleVector

getNativeHighValues

  • getNativeHighValues(): SCRTDoubleVector
  • Gets a native / WebAssembly vector of High-values in the DataSeries

    Returns SCRTDoubleVector

getNativeIndexes

  • getNativeIndexes(): SCRTDoubleVector

getNativeLowValues

  • getNativeLowValues(): SCRTDoubleVector
  • Gets a native / WebAssembly vector of Low-values in the DataSeries

    Returns SCRTDoubleVector

getNativeOpenValues

  • getNativeOpenValues(): SCRTDoubleVector
  • Gets a native / WebAssembly vector of Open-values in the DataSeries

    Returns SCRTDoubleVector

getNativeXValues

  • getNativeXValues(): SCRTDoubleVector

getNativeYValues

  • getNativeYValues(): SCRTDoubleVector

getWindowedYRange

getXRange

Protected getXValues

hasMetadataGenerator

  • hasMetadataGenerator(): boolean

insert

  • insert(startIndex: number, x: number, open: number, high: number, low: number, close: number, metadata?: IPointMetadata): void
  • Inserts a single Date, Open, High, Low, Close value at the X-index

    remarks

    Any changes of the DataSeries will trigger a redraw on the parent SciChartSurface

    Parameters

    • startIndex: number

      the index to insert at

    • x: number

      the X-value (date) encoded as a Unix Timestamp

    • open: number

      The Open value

    • high: number

      The High value

    • low: number

      The Low value

    • close: number

      The Close value

    • Optional metadata: IPointMetadata

      The point metadata

    Returns void

Protected insertMetadata

Protected insertMetadataRange

  • insertMetadataRange(startIndex: number, metadata: IPointMetadata[]): void

insertRange

  • Inserts a range of Date, Open, High, Low, Close value at the X-index

    remarks

    Any changes of the DataSeries will trigger a redraw on the parent SciChartSurface

    Parameters

    Returns void

notifyDataChanged

  • notifyDataChanged(changeType: EDataChangeType, index: number, count: number, name?: string): void

removeAt

  • removeAt(index: number): void
  • Removes a Date,Open,High,Low,Close value at the specified index

    remarks

    Any changes of the DataSeries will trigger a redraw on the parent SciChartSurface

    Parameters

    • index: number

      the index to remove at

    Returns void

Protected removeMetadataAt

  • removeMetadataAt(index: number): void

Protected removeMetadataRange

  • removeMetadataRange(startIndex: number, count: number): void

removeRange

  • removeRange(startIndex: number, count: number): void
  • Removes a range of Date,Open,High,Low,Close values at the specified index

    remarks

    Any changes of the DataSeries will trigger a redraw on the parent SciChartSurface

    Parameters

    • startIndex: number

      the start index to remove at

    • count: number

      the number of points to remove

    Returns void

setFinalAnimationVectors

setInitialAnimationVectors

Protected setMetadata

Protected setMetadataAt

setMetadataGenerator

  • Sets a function that will be used to generate metadata for values when they are appended/inserted, if no explicit metadata is supplied.

    Parameters

    Returns void

toJSON

  • toJSON(excludeData?: boolean): any
  • Convert the object to a definition that can be serialized to JSON, or used directly with the builder api

    Parameters

    • Default value excludeData: boolean = false

      if set true, data values will not be included in the json.

    Returns any

update

  • update(index: number, open: number, high: number, low: number, close: number, metadata?: IPointMetadata): void
  • Updates a single Open, High, Low, Close value by X-index

    remarks

    Any changes of the DataSeries will trigger a redraw on the parent SciChartSurface

    Parameters

    • index: number

      the index to update

    • open: number

      The new Open value

    • high: number

      The new High value

    • low: number

      The new Low value

    • close: number

      The new Close value

    • Optional metadata: IPointMetadata

      The point metadata

    Returns void

updateAnimationProperties

  • updateAnimationProperties(progress: number, animation: SeriesAnimation): void

updateXohlc

  • updateXohlc(index: number, x: number, open: number, high: number, low: number, close: number, metadata?: IPointMetadata): void
  • Updates a single X, Open, High, Low, Close value by X-index. Might also need to set isSorted = false

    remarks

    Any changes of the DataSeries will trigger a redraw on the parent SciChartSurface

    Parameters

    • index: number

      the index to update

    • x: number

      The new X value

    • open: number

      The new Open value

    • high: number

      The new High value

    • low: number

      The new Low value

    • close: number

      The new Close value

    • Optional metadata: IPointMetadata

      The point metadata

    Returns void

validateAnimationVectors

  • validateAnimationVectors(): void

Protected validateIndex

  • validateIndex(index: number, message?: string): void
  • Parameters

    • index: number
    • Optional message: string

    Returns void

Generated using TypeDoc