Companion

object Companion

Houses ItemPlacer factory functions.

Functions

Link copied to clipboard
fun aligned(spacing: (ExtraStore) -> Int = { 1 }, offset: (ExtraStore) -> Int = { 0 }, shiftExtremeLines: Boolean = true, addExtremeLabelPadding: Boolean = true, shiftExtremeLabels: Boolean = false): HorizontalAxis.ItemPlacer

Adds a label, tick, and guideline for each x value given by CartesianChartRanges.minX + (k × spacing + offset) × CartesianChartRanges.xStep, where k ∈ ℕ, with these components being horizontally centered relative to one another. shiftExtremeLines is used as the return value of ItemPlacer.getShiftExtremeLines. addExtremeLabelPadding specifies whether CartesianLayer padding should be added for the first and last labels, ensuring their visibility. shiftExtremeLabels is used as the return value of ItemPlacer.getShiftExtremeLabels. If both addExtremeLabelPadding and shiftExtremeLabels are enabled, shiftExtremeLabels takes precedence: The first and last labels are anchored inward, and no extreme-label padding is added.

Link copied to clipboard
fun extremes(shiftExtremeLines: Boolean = true): HorizontalAxis.ItemPlacer

Places labels, ticks, and guidelines only at CartesianChartRanges.minX and CartesianChartRanges.maxX. The first label is end-aligned and the last is start-aligned, anchoring them to the plot-area edges without shrinking the plot area. Under scroll or zoom, labels remain at the data extremes (they scroll off-screen when out of view). shiftExtremeLines is used as the return value of ItemPlacer.getShiftExtremeLines.

Link copied to clipboard
fun segmented(shiftExtremeLines: Boolean = true): HorizontalAxis.ItemPlacer

Adds a label for each major x value, and adds ticks between the labels and for CartesianChartRanges.minXCartesianChartRanges.xStep ÷ 2 and CartesianChartRanges.maxX + CartesianChartRanges.xStep ÷ 2. (Major x values are given by CartesianChartRanges.minX + k × CartesianChartRanges.xStep, where k ∈ ℕ.) shiftExtremeLines is used as the return value of ItemPlacer.getShiftExtremeLines.