Chart

Defines the minimal set of properties and functions required by other parts of the library to draw a chart.

Inheritors

Types

Link copied to clipboard
abstract class ModelTransformer<in Model>

Transforms Models into DrawingModels.

Link copied to clipboard

Properties

Link copied to clipboard

Overrides the minimum and maximum x-axis and y-axis values. In the case of ColumnCharts and LineCharts contained in ComposedCharts, these overrides can be applied to one vertical axis instead of both. Use ColumnChart.targetVerticalAxisPosition and LineChart.targetVerticalAxisPosition for this purpose.

Link copied to clipboard

A Collection of the ChartInsetters that are part of this Chart. Each ChartInsetter can influence the final layout of the chart and its components.

Link copied to clipboard

Links x-axis values to Marker.EntryModels. A Marker.EntryModel holds the data needed to draw a Marker.

Link copied to clipboard
abstract var maxX: Float?

The maximum value shown on the x-axis. If Model implements ChartEntryModel, and maxX is not null, this overrides ChartEntryModel.maxX.

Link copied to clipboard
abstract var maxY: Float?

The maximum value shown on the y-axis. If Model implements ChartEntryModel, and maxY is not null, this overrides ChartEntryModel.maxY.

Link copied to clipboard
abstract var minX: Float?

The minimum value shown on the x-axis. If Model implements ChartEntryModel, and minX is not null, this overrides ChartEntryModel.minX.

Link copied to clipboard
abstract var minY: Float?

The minimum value shown on the y-axis. If Model implements ChartEntryModel, and minY is not null, this overrides ChartEntryModel.minY.

Functions

Link copied to clipboard
abstract fun addDecoration(decoration: Decoration): Boolean

Adds a Decoration to this Chart.

Link copied to clipboard

Adds each Decoration from decorations to this Chart.

Link copied to clipboard
abstract fun addPersistentMarker(x: Float, marker: Marker)

Adds a persistent Marker to this Chart. The Marker will be anchored to the given x value on the x-axis.

Link copied to clipboard
abstract fun drawNonScrollableContent(context: ChartDrawContext, model: Model)

Responsible for drawing any decorations placed above the chart, as well as persistent markers.

Link copied to clipboard
abstract fun drawScrollableContent(context: ChartDrawContext, model: Model)

Responsible for drawing the chart itself and any decorations behind it.

Link copied to clipboard

Combines this Chart with another one to create a ComposedChart.

Link copied to clipboard
abstract fun removeDecoration(decoration: Decoration): Boolean

Removes a Decoration from this Chart.

Link copied to clipboard
open fun removeDecorations(decorations: List<Decoration>): Boolean

Removes each Decoration from decorations from this Chart.

Link copied to clipboard
abstract fun removePersistentMarker(x: Float)

Removes a persistent Marker from this Chart.

Link copied to clipboard
abstract fun setDecorations(decorations: List<Decoration>)

Replaces the current list of decorations with the provided decorations.

Link copied to clipboard
abstract fun setPersistentMarkers(markers: Map<Float, Marker>)

Replaces the current map of markers with the provided markers.

Link copied to clipboard
abstract fun updateChartValues(chartValuesManager: ChartValuesManager, model: Model, xStep: Float?)

Updates the ChartValues stored in the provided ChartValuesManager instance to this Chart’s ChartValues.

Link copied to clipboard
abstract fun updateHorizontalDimensions(context: MeasureContext, horizontalDimensions: MutableHorizontalDimensions, model: Model)

Updates the chart’s MutableHorizontalDimensions instance.