Constant

class Constant<DOMAIN, VALUE>(value: VALUE, init: Constant<DOMAIN, VALUE>.() -> Unit) : DiscreteDimension<DOMAIN, VALUE>

Constant is a Dimension that always returns the same <VALUE> object for any <DOMAIN> object. It is build by giving a single <VALUE> object.

Use the Chart.constant function to build a Constant dimension.

Notes:

  • This Dimension is not designed for axes.

  • A Constant dimension is considered "discrete".

Constructors

Constant
Link copied to clipboard
common
fun <DOMAIN, VALUE> Constant(value: VALUE, init: Constant<DOMAIN, VALUE>.() -> Unit = {})

Functions

invoke
Link copied to clipboard
common
operator fun invoke(datum: Datum<DOMAIN>): VALUE
Calling Dimension(Datum) is the same as calling its accessor.

Properties

accessor
Link copied to clipboard
common
val accessor: Datum<DOMAIN>.() -> VALUE
The "accessor" is the lambda used to transform a DOMAIN object into a VALUE.
formatter
Link copied to clipboard
common
open var formatter: VALUE.() -> String?
The formatter for the VALUE this Dimension can generate.
isContinuous
Link copied to clipboard
common
val isContinuous: Boolean
Is this Dimension considered "continuous"?
isDiscrete
Link copied to clipboard
common
open override val isDiscrete: Boolean
Is this Dimension considered "discrete"?
name
Link copied to clipboard
common
var name: String?
The name of this Dimension, this name is used as the title of the Axis based on it.