CartesianChart

open class CartesianChart(layers: CartesianLayer<*>, startAxis: Axis<Axis.Position.Vertical.Start>? = null, topAxis: Axis<Axis.Position.Horizontal.Top>? = null, endAxis: Axis<Axis.Position.Vertical.End>? = null, bottomAxis: Axis<Axis.Position.Horizontal.Bottom>? = null, var marker: CartesianMarker? = null, var markerVisibilityListener: CartesianMarkerVisibilityListener? = null, var layerPadding: CartesianLayerPadding = CartesianLayerPadding(), var legend: Legend<CartesianMeasuringContext, CartesianDrawingContext>? = null, var fadingEdges: FadingEdges? = null, var decorations: List<Decoration> = emptyList(), var persistentMarkers: CartesianChart.PersistentMarkerScope.(ExtraStore) -> Unit? = null, var getXStep: (CartesianChartModel) -> Double = { it.getXDeltaGcd() }) : CartesianLayerInsetter<CartesianChartModel>

A chart based on a Cartesian coordinate plane, composed of CartesianLayers.

Parameters

startAxis

the start Axis.

topAxis

the top Axis.

endAxis

the end Axis.

bottomAxis

the bottom Axis.

Constructors

Link copied to clipboard
constructor(vararg layers: CartesianLayer<*>, startAxis: Axis<Axis.Position.Vertical.Start>? = null, topAxis: Axis<Axis.Position.Horizontal.Top>? = null, endAxis: Axis<Axis.Position.Vertical.End>? = null, bottomAxis: Axis<Axis.Position.Horizontal.Bottom>? = null, marker: CartesianMarker? = null, markerVisibilityListener: CartesianMarkerVisibilityListener? = null, layerPadding: CartesianLayerPadding = CartesianLayerPadding(), legend: Legend<CartesianMeasuringContext, CartesianDrawingContext>? = null, fadingEdges: FadingEdges? = null, decorations: List<Decoration> = emptyList(), persistentMarkers: CartesianChart.PersistentMarkerScope.(ExtraStore) -> Unit? = null, getXStep: (CartesianChartModel) -> Double = { it.getXDeltaGcd() })

Types

Link copied to clipboard
fun interface PersistentMarkerScope

Facilitates adding persistent CartesianMarkers to CartesianCharts.

Properties

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard

applies a horizontal fade to the edges of the CartesianChart, provided that it’s scrollable.

Link copied to clipboard

defines the x step (the difference between neighboring major x values).

Link copied to clipboard

stores the CartesianLayer padding values.

Link copied to clipboard

The CartesianLayers of which this CartesianChart is composed.

Link copied to clipboard
Link copied to clipboard

appears when the CartesianChart is tapped.

Link copied to clipboard
Link copied to clipboard

allows for listening to marker visibility changes.

Link copied to clipboard
Link copied to clipboard

Functions

Link copied to clipboard
fun draw(context: CartesianDrawingContext, pointerPosition: Point?)

Draws the CartesianChart.

Link copied to clipboard
fun prepare(context: CartesianMeasuringContext, horizontalDimensions: MutableHorizontalDimensions, canvasBounds: RectF)

Prepares the CartesianChart for drawing.

Link copied to clipboard

Prepares the CartesianLayers for a difference animation.

Link copied to clipboard
suspend fun transform(extraStore: MutableExtraStore, fraction: Float)

Carries out the pending difference animation.

Link copied to clipboard
open override fun updateHorizontalInsets(context: CartesianMeasuringContext, freeHeight: Float, model: CartesianChartModel, insets: HorizontalInsets)

Ensures that there are sufficient horizontal insets. freeHeight is the height of the CartesianLayer area.

Link copied to clipboard
open override fun updateInsets(context: CartesianMeasuringContext, horizontalDimensions: HorizontalDimensions, model: CartesianChartModel, insets: Insets)

Ensures that there are sufficient insets.

Link copied to clipboard

Updates ranges in accordance with model.