Types

Link copied to clipboard
object Companion
Link copied to clipboard
inner class Transaction

Handles data updates. An initially empty list of data sets is created and can be updated via the class’s functions. Each data set corresponds to a single nested Chart.

Functions

Link copied to clipboard

Returns the ChartEntryModel or, if no ChartEntryModel is available, null.

Link copied to clipboard
open override fun isRegistered(key: Any): Boolean

Checks if an update listener with the given key is registered.

Link copied to clipboard
open override fun registerForUpdates(key: Any, cancelAnimation: () -> Unit, startAnimation: (transformModel: suspend (chartKey: Any, fraction: Float) -> Unit) -> Unit, getOldModel: () -> ComposedChartEntryModel<ChartEntryModel>?, modelTransformerProvider: Chart.ModelTransformerProvider?, extraStore: MutableExtraStore, updateChartValues: (ComposedChartEntryModel<ChartEntryModel>?) -> ChartValuesProvider, onModelCreated: (ComposedChartEntryModel<ChartEntryModel>?) -> Unit)

Registers an update listener associated with a key. cancelAnimation and startAnimation are called after a data update is requested, with cancelAnimation being called before the update starts being processed (at which point transformModel should stop being used), and startAnimation being called once the update has been processed (at which point it’s safe to use transformModel). updateChartValues updates the chart’s ChartValues and returns its ChartValuesProvider. onModelCreated is called when a new Model has been generated.

open override fun registerForUpdates(key: Any, cancelAnimation: () -> Unit, startAnimation: (transformModel: suspend (key: Any, fraction: Float) -> Unit) -> Unit, getOldModel: () -> ComposedChartEntryModel<ChartEntryModel>?, modelTransformerProvider: Chart.ModelTransformerProvider?, extraStore: MutableExtraStore, updateChartValues: (ComposedChartEntryModel<ChartEntryModel>?) -> ChartValuesProvider, onModelCreated: (ComposedChartEntryModel<ChartEntryModel>?, ChartValuesProvider) -> Unit)

Registers an update listener associated with a key. cancelAnimation and startAnimation are called after a data update is requested, with cancelAnimation being called before the update starts being processed, and startAnimation being called once the update has been processed. updateChartValues updates the chart’s ChartValues and returns its ChartValuesProvider. onModelCreated is called when a new Model has been generated.

Link copied to clipboard

Creates a Transaction, runs block, and calls Transaction.commit, returning its output. For suspending behavior, use runTransactionSuspending.

Link copied to clipboard

Creates a Transaction, runs block, and calls Transaction.commitSuspending, returning its output.

Link copied to clipboard
open suspend override fun transformModel(key: Any, fraction: Float)

Creates an intermediate ChartEntryModel for difference animations. fraction is the balance between the initial and target ChartEntryModels.

Link copied to clipboard
open override fun unregisterFromUpdates(key: Any)

Unregisters the update listener associated with the given key.