Axis

open class Axis<DOMAIN, VALUE>(data: List<Datum<DOMAIN>>, dimension: Dimension<DOMAIN, VALUE>, config: AxisConfig) : Scaler<VALUE> , AxisConfig

The core "axis" component for a given Mark.

Generally, a Chart will have several Dimensions that can be shared between the different Marks, the Axis is the concrete use of a Dimension for a given Mark.

See also

AxisRenderer

The visual part of the axis component.

Constructors

Axis
Link copied to clipboard
common
fun <DOMAIN, VALUE> Axis(data: List<Datum<DOMAIN>>, dimension: Dimension<DOMAIN, VALUE>, config: AxisConfig)

Functions

getLabel
Link copied to clipboard
common
fun getLabel(datum: Datum<DOMAIN>): String?
Return the labels for a Datum from this Axis Dimension "point of view.
getPosition
Link copied to clipboard
common
fun getPosition(datum: Datum<DOMAIN>): Double?
Return the position of this Datum object, along this Axis, or null if this object has no position.
invert
Link copied to clipboard
common
open override fun invert(value: Double): VALUE
Transform a Double into a VALUE object (if possible), this is the inverse of the scaleValue function.
scaleValue
Link copied to clipboard
common
open override fun scaleValue(value: VALUE): Double
Transform a VALUE object into a Double.
smartTickCount
Link copied to clipboard
common
open override fun smartTickCount(rangeSize: Double): Int
Compute a "smart" tick count for the given scale.
ticks
Link copied to clipboard
common
fun ticks(getTicks: () -> List<VALUE>)
Specify the lambda to retrieve ticks.

Properties

alternateBackgroundColor
Link copied to clipboard
common
open override var alternateBackgroundColor: Color
The color of the alternate background bands.
autoFit
Link copied to clipboard
common
open override var autoFit: Boolean
When autofit is enabled, the start and end of the axis is rounded to "nice values".
axisLabelLayout
Link copied to clipboard
common
open override var axisLabelLayout: AxisLabelLayout
Layout of the ticks labels over the axis line (below, over...).
bandwidthRatio
Link copied to clipboard
common
open override var bandwidthRatio: Percent
Changing the bandwidth must launch a rescale
config
Link copied to clipboard
common
val config: AxisConfig
The AxisConfig of this Axis
dimension
Link copied to clipboard
common
val dimension: Dimension<DOMAIN, VALUE>
The Dimension this Axis is build from.
discreteTickSkip
Link copied to clipboard
common
open override var discreteTickSkip: TickSkip
Tick-sipping behavior for a discrete axis.
enableAlternateBackground
Link copied to clipboard
common
open override var enableAlternateBackground: Boolean
Show hide alternate background (colored bands, drawn on ticks under the Marks).
enableAxis
Link copied to clipboard
common
open override var enableAxis: Boolean
Show or hide the whole axis component.
enableAxisLine
Link copied to clipboard
common
open override var enableAxisLine: Boolean
Show or hide the axis line.
enableBandwidth
Link copied to clipboard
common
open override var enableBandwidth: Bandwidth
Changing the "pointAxis" must launch a rescale
enableGridLines
Link copied to clipboard
common
open override var enableGridLines: Boolean
Show hide gridlines (lines drawn on ticks under the Marks).
enableTicks
Link copied to clipboard
common
open override var enableTicks: Boolean
Show or hide the axis ticks.
enableTicksLabels
Link copied to clipboard
common
open override var enableTicksLabels: Boolean
Show or hide the axis ticks labels.
enableTitle
Link copied to clipboard
common
open override var enableTitle: Boolean
Show / hide axis title.
end
Link copied to clipboard
common
var end: VALUE? = null
The ending value of your axis visual range.
fontColor
Link copied to clipboard
common
open override var fontColor: Color
The font Color.
fontFamily
Link copied to clipboard
common
open override var fontFamily: FontFamily
The font family (FontFamily).
fontSize
Link copied to clipboard
common
open override var fontSize: Double
The font size.
fontStyle
Link copied to clipboard
common
open override var fontStyle: FontPosture
The font posture (FontPosture): italic or normal.
fontWeight
Link copied to clipboard
common
open override var fontWeight: FontWeight
The font weight (FontWeight): bold or normal.
gridLinesColor
Link copied to clipboard
common
open override var gridLinesColor: Color
The color used to draw the grid lines.
gridLinesDashed
Link copied to clipboard
common
open override var gridLinesDashed: DoubleArray?
The "dash style" of the grid lines, use null for a solid line.
gridLinesWidth
Link copied to clipboard
common
open override var gridLinesWidth: Double
The thickness of the grid lines.
layoutPosition
Link copied to clipboard
common
open override var layoutPosition: LayoutPosition
Expected position for the axis relative to the main charting zone.
max
Link copied to clipboard
common
var max: VALUE? = null
The maximal value your axis can display, constrain your zoom, pan...
min
Link copied to clipboard
common
var min: VALUE? = null
The minimal value your axis can display, constrain your zoom, pan...
orientation
Link copied to clipboard
common
open override val orientation: Orientation
The Orientation of this axis configuration.
renderer
Link copied to clipboard
common
var renderer: () -> AxisRenderer
This axis renderer, use DefaultAxisRenderer by default but you can specify your own custom AxisRenderer.
scale
Link copied to clipboard
common
var scale: Scale<VALUE, Double>
The "Scale" is the interpolator that is used to transform one of your value (could be a Double, an Instant...) to a screen position.
start
Link copied to clipboard
common
var start: VALUE? = null
The starting value of your axis visual range.
strokeColor
Link copied to clipboard
common
open override var strokeColor: Color?
The stroke Color, use null for no stroke.
strokeWidth
Link copied to clipboard
common
open override var strokeWidth: Double?
The stroke thickness, null for no stroke.
tickCount
Link copied to clipboard
common
open override var tickCount: Int?
The expected tick count for the Axis, null for activating "smart tick count".
tickPadding
Link copied to clipboard
common
open override var tickPadding: Double
The padding between the tick and its label.
ticks
Link copied to clipboard
common
var ticks: List<VALUE>? = null
Specify a List of VALUES for the ticks, if none is defined, this Axis will compute its own ticks.
tickSize
Link copied to clipboard
common
open override var tickSize: Double
The size (length) of a tick.
tickStroke
Link copied to clipboard
common
open override var tickStroke: Color?
The ticks stroke Color, if null ticks won't draw.
tickStrokeWidth
Link copied to clipboard
common
open override var tickStrokeWidth: Double?
The ticks stroke thickness, if null ticks won't draw.
tickValues
Link copied to clipboard
common
open override val tickValues: List<VALUE>
Produces a List of VALUE that will be used to place "ticks" on an axis.
values
Link copied to clipboard
common
val values: List<VALUE?>
A List of VALUE corresponding to every DOMAIN element pass through this Axis's Dimension accessor.