ChartStyling

Utility object for chart styling and component creation. Provides reusable styled lines, points, and axes for Vico charts.

Properties

Link copied to clipboard
const val LARGE_POINT_SIZE_DP: Float = 10.0f
Link copied to clipboard
const val MEDIUM_LINE_WIDTH_DP: Float = 2.0f
Link copied to clipboard
const val MEDIUM_POINT_SIZE_DP: Float = 8.0f
Link copied to clipboard
const val SMALL_POINT_SIZE_DP: Float = 6.0f
Link copied to clipboard
const val THICK_LINE_WIDTH_DP: Float = 2.5f
Link copied to clipboard
const val THIN_LINE_WIDTH_DP: Float = 1.5f

Functions

Link copied to clipboard
fun createBoldLine(lineColor: ERROR CLASS: Symbol not found for Color, pointSize: Float? = LARGE_POINT_SIZE_DP): ERROR CLASS: Symbol not found for LineCartesianLayer.Line

Creates a bold line suitable for highlighting primary metrics.

Link copied to clipboard
fun createColoredMarkerValueFormatter(format: (value: Double, @R|kotlin/ParameterName|(name = String(color)) ERROR CLASS: Symbol not found for Color) -> String): ERROR CLASS: Symbol not found for DefaultCartesianMarker.ValueFormatter

Creates a DefaultCartesianMarker.ValueFormatter that colors the text to match the series color.

Link copied to clipboard
fun createGradientLine(lineColor: ERROR CLASS: Symbol not found for Color, pointSize: Float? = MEDIUM_POINT_SIZE_DP, lineWidth: Float = MEDIUM_LINE_WIDTH_DP): ERROR CLASS: Symbol not found for LineCartesianLayer.Line

Creates a line with a gradient fill effect. The gradient goes from the line color to transparent.

Link copied to clipboard
fun createPointOnlyLine(pointColor: ERROR CLASS: Symbol not found for Color, pointSize: Float = MEDIUM_POINT_SIZE_DP): ERROR CLASS: Symbol not found for LineCartesianLayer.Line

Creates a transparent line (no line, only points). Useful for distinguishing multiple metrics on the same chart.

Link copied to clipboard
fun createStyledLine(lineColor: ERROR CLASS: Symbol not found for Color, pointSize: Float? = MEDIUM_POINT_SIZE_DP, lineWidth: Float = MEDIUM_LINE_WIDTH_DP): ERROR CLASS: Symbol not found for LineCartesianLayer.Line

Creates a solid line with optional point markers.

Link copied to clipboard
fun createSubtleLine(lineColor: ERROR CLASS: Symbol not found for Color, pointSize: Float? = SMALL_POINT_SIZE_DP): ERROR CLASS: Symbol not found for LineCartesianLayer.Line

Creates a subtle line suitable for secondary metrics.

Link copied to clipboard
fun createThemedColor(baseColor: ERROR CLASS: Symbol not found for Color, alpha: Float = 1.0f): ERROR CLASS: Symbol not found for Color

Gets Material 3 theme-aware colors with opacity. Useful for creating color variants while respecting the current theme.

Link copied to clipboard
fun rememberAxisLabel(color: ERROR CLASS: Symbol not found for Color = MaterialTheme.colorScheme.onSurfaceVariant): ERROR CLASS: Symbol not found for TextComponent

Creates and remembers a com.patrykandpatrick.vico.compose.common.component.TextComponent styled for axis labels.

Link copied to clipboard
fun rememberItemPlacer(spacing: Int = 50): ERROR CLASS: Symbol not found for com.patrykandpatrick.vico.compose.cartesian.axis.HorizontalAxis.ItemPlacer

Creates a standard com.patrykandpatrick.vico.compose.cartesian.axis.HorizontalAxis.ItemPlacer with optimized spacing.

Link copied to clipboard
fun rememberMarker(valueFormatter: ERROR CLASS: Symbol not found for DefaultCartesianMarker.ValueFormatter = DefaultCartesianMarker.ValueFormatter.default(colorCode = true), showIndicator: Boolean = true): ERROR CLASS: Symbol not found for CartesianMarker

Creates and remembers a default CartesianMarker styled for the Meshtastic theme.