Package-level declarations

Types

Link copied to clipboard

Shared defaults for Cartesian axes.

Link copied to clipboard
data class AxesStyle(val visible: Boolean, val lines: AxisLinesStyle, val grid: GridStyle, val xLabels: AxisLabelStyle, val yLabels: AxisLabelStyle)

Axis lines, grid, and labels shared by Cartesian charts.

Link copied to clipboard

Shared defaults for X- and Y-axis labels.

Link copied to clipboard
data class AxisLabelStyle(val visible: Boolean, val color: Color, val size: TextUnit, val maxCount: Int?)

Axis label configuration shared by Cartesian charts.

Link copied to clipboard

Shared defaults for axis strokes.

Link copied to clipboard
data class AxisLinesStyle(val visible: Boolean, val color: Color, val lineWidth: Dp)

X- and Y-axis strokes.

Link copied to clipboard
data class BarBarsStyle(val color: Color, val colors: ImmutableList<Color>, val gradient: ChartGradient?, val alpha: Float, val space: Dp, val minBarWidth: Dp)

Bar visual configuration shared by vertical bar and histogram charts.

Link copied to clipboard

Defaults factory for BarChartStyle. All parameters have theme-aware defaults.

Link copied to clipboard
class BarChartStyle(val chartContainerStyle: ChartContainerStyle, val bars: BarBarsStyle, val range: BarRangeStyle, val axes: AxesStyle, val selection: BarSelectionStyle, val zoomControlsVisible: Boolean)

Immutable v3 style for vertical io.github.hdcharts.bar.BarChart.

Link copied to clipboard
data class BarRangeStyle(val min: Double?, val max: Double?)

Optional fixed Y-axis range for vertical bar and histogram charts.

Link copied to clipboard
data class BarSelectionStyle(val visible: Boolean, val color: Color, val width: Dp, val unselectedAlpha: Float)

Selection indicator configuration for vertical bar and histogram charts.

Link copied to clipboard

An object that provides default styles for a chart container.

Link copied to clipboard
class ChartContainerStyle(val styleTitle: TextStyle, val contentPadding: Dp, val styleSubtitle: TextStyle = TextStyle( fontSize = StyleDefaults.subtitleSize, fontWeight = StyleDefaults.subtitleWeight, textAlign = TextAlign.Start, ))

Presentation-only container style shared by every chart.

Link copied to clipboard
sealed interface ChartGradient

A gradient that paints a chart shape, such as a bar or stacked area layer.

Link copied to clipboard

Ready-made ChartGradients with evenly spaced colors.

Link copied to clipboard
data class GradientPoint(val x: Float, val y: Float)

A position as fractions of a gradient's bounds: (0, 0) is the top-left corner and (1, 1) the bottom-right. Values outside 0..1 sit outside the bounds.

Link copied to clipboard

The bounds a ChartGradient's positions are fractions of.

Link copied to clipboard
sealed interface GradientStop

A color at offset along a gradient.

Link copied to clipboard

Shared defaults for GridStyle.

Link copied to clipboard
data class GridStyle(val visible: Boolean, val steps: Int, val color: Color, val lineWidth: Dp)

Horizontal grid configuration shared by charts with a numeric Y axis.

Link copied to clipboard

Defaults factory for HistogramChartStyle. Histograms render pre-binned values (one Double per bin) at equal visual widths and a zero baseline by default.

Link copied to clipboard
class HistogramChartStyle(val chartContainerStyle: ChartContainerStyle, val bars: BarBarsStyle, val range: BarRangeStyle, val axes: AxesStyle, val selection: BarSelectionStyle, val zoomControlsVisible: Boolean)
Link copied to clipboard

Shared defaults for LegendStyle.

Link copied to clipboard
data class LegendStyle(val visible: Boolean)

Shared legend visibility configuration.

Link copied to clipboard

Every chart style default in one place, so the same element looks the same in every chart.

Functions

Link copied to clipboard

Returns this made drawable, or null when it cannot be drawn, so the shape is solid.

Clamps stroke widths and grid steps. Label sizes pass through for validation.

Returns this with alphas, sizes, and grid steps clamped to drawable values.

Returns this with GridStyle.steps and GridStyle.lineWidth clamped. Names every field instead of using copy, so a field added to the constructor fails to compile here until it is dealt with.