Skip to main content

Data series

Work with chart data dynamically by setting new series, updating existing ones, or removing them as needed.

Set a candle series

Use ChartComponent.setAllSeries to define one or more candle series on the chart.

ChartComponent.setAllSeries
ChartComponent.setAllSeries(mainSeries: CandleSeries, secondarySeries: CandleSeries[]): void

Sets the main and secondary series in one bulk operation. Reindexing and visual rerender happens at the same time.

Parameters
mainSeries: CandleSeries
secondarySeries: CandleSeries[]
Returns
void

Examples

Set single main series


Set multiple series


Update a data series

Use ChartComponent.updateAllSeries to apply changes to current series data.

ChartComponent.updateAllSeries
ChartComponent.updateAllSeries(mainSeries: CandleSeries, secondarySeries: CandleSeries[]): void

Updates the main and secondary series in one bulk operation. Reindexing and visual rerender happens at the same time.

Parameters
mainSeries: CandleSeries
secondarySeries: CandleSeries[]
Returns
void

Examples


Remove a data series

ChartComponent.removeDataFrom
ChartComponent.removeDataFrom(timestamp: number): void

Removes all data points from the main candle series that are newer than the given timestamp. Can be useful for data replay.

Parameters
timestamp: number
Returns
void

Examples