Transaction

inner class Transaction

Handles data updates. An initially empty list of CartesianLayerModel.Partials is created and can be updated via the class’s functions. Each CartesianLayerModel.Partial corresponds to a CartesianLayer.

Constructors

Link copied to clipboard
constructor()

Functions

Link copied to clipboard
Link copied to clipboard

Creates a CandlestickCartesianLayerModel.Partial with the provided prices, using their indices as the x values, and adds it to the CartesianChartModelProducer.Transaction’s CartesianLayerModel.Partial list. opening, closing, low, and high should have the same sizes.

Creates a CandlestickCartesianLayerModel.Partial with the provided x values (x) and prices and adds it to the CartesianChartModelProducer.Transaction’s CartesianLayerModel.Partial list. opening, closing, low, and high should have the same sizes.

Link copied to clipboard
suspend fun commit()

Runs a data update, returning once the update is complete. If there’s already an update in progress, the current coroutine is first suspended until the ongoing update’s completion. An update is complete once a new CartesianChartModel has been generated, and the CartesianChart hosts have been notified.

Link copied to clipboard
fun extras(block: (MutableExtraStore) -> Unit)

Allows for adding auxiliary values, which can later be retrieved via CartesianChartModel.extraStore.