ItemPlacer

interface ItemPlacer

Determines for what x values a HorizontalAxis displays labels, ticks, and guidelines.

Types

Link copied to clipboard
object Companion

Houses ItemPlacer factory functions.

Functions

Link copied to clipboard
abstract fun getEndHorizontalAxisInset(context: CartesianMeasuringContext, horizontalDimensions: HorizontalDimensions, tickThickness: Float, maxLabelWidth: Float): Float

Returns the end inset required by the HorizontalAxis.

Link copied to clipboard
open fun getFirstLabelValue(context: CartesianMeasuringContext, maxLabelWidth: Float): Double?

If the HorizontalAxis is to reserve room for the first label, returns the first label’s x value. Otherwise, returns null.

Link copied to clipboard
abstract fun getHeightMeasurementLabelValues(context: CartesianMeasuringContext, horizontalDimensions: HorizontalDimensions, fullXRange: ClosedFloatingPointRange<Double>, maxLabelWidth: Float): List<Double>

Returns, as a list, the x values for which the HorizontalAxis is to create labels and measure their heights during the measuring phase. This affects how much vertical space the HorizontalAxis requests.

Link copied to clipboard
abstract fun getLabelValues(context: CartesianDrawingContext, visibleXRange: ClosedFloatingPointRange<Double>, fullXRange: ClosedFloatingPointRange<Double>, maxLabelWidth: Float): List<Double>

Returns, as a list, the x values for which labels are to be displayed, restricted to visibleXRange and with two extra values on either side (if applicable).

Link copied to clipboard
open fun getLastLabelValue(context: CartesianMeasuringContext, maxLabelWidth: Float): Double?

If the HorizontalAxis is to reserve room for the last label, returns the last label’s x value. Otherwise, returns null.

Link copied to clipboard
open fun getLineValues(context: CartesianDrawingContext, visibleXRange: ClosedFloatingPointRange<Double>, fullXRange: ClosedFloatingPointRange<Double>, maxLabelWidth: Float): List<Double>?

Returns, as a list, the x values for which ticks and guidelines are to be displayed, restricted to visibleXRange and with an extra value on either side (if applicable). If null is returned, the values returned by getLabelValues are used.

Link copied to clipboard

Returns a boolean indicating whether to shift the lines whose x values are bounds of the effective x range, if such lines are present, such that they’re immediately outside of the CartesianLayer bounds. (The effective x range includes the CartesianLayer padding.) On either side, if a VerticalAxis is present, the shifted tick will then be aligned with the axis line, and the shifted guideline will be hidden.

Link copied to clipboard
abstract fun getStartHorizontalAxisInset(context: CartesianMeasuringContext, horizontalDimensions: HorizontalDimensions, tickThickness: Float, maxLabelWidth: Float): Float

Returns the start inset required by the HorizontalAxis.

Link copied to clipboard

Returns, as a list, the x values for which the HorizontalAxis is to create labels and measure their widths during the measuring phase. The width of the widest label is passed to other functions.