Package-level declarations

Types

Link copied to clipboard

The LabelConnectorScope provides geometry information to LabelConnector implementations so they can draw the connector from the graph element to the label.

Link copied to clipboard

Scope for Pie slices.

Functions

Link copied to clipboard
fun LabelConnectorScope.BezierLabelConnector(modifier: Modifier = Modifier, connectorColor: Color = MaterialTheme.colorScheme.onBackground, connectorStroke: Stroke = Stroke(width = 1f))

A label connector that uses a Bezier curve.

Link copied to clipboard
fun PieSliceScope.DefaultSlice(color: Color, modifier: Modifier = Modifier, border: BorderStroke? = null, hoverExpandFactor: Float = 1.0f, hoverElement: @Composable () -> Unit = {}, clickable: Boolean = false, antiAlias: Boolean = false, gap: Float = 0.0f, onClick: () -> Unit = {})

A default pie chart slice implementation that can form full slices as well as slices with a "hole" for donut charts.

Link copied to clipboard
fun PieChart(values: List<Float>, modifier: Modifier = Modifier, slice: @Composable PieSliceScope.(Int) -> Unit = { val colors = remember(values.size) { generateHueColorPalette(values.size) } DefaultSlice(colors[it]) }, label: @Composable (Int) -> Unit = {}, labelConnector: @Composable LabelConnectorScope.(Int) -> Unit = { StraightLineConnector() }, labelSpacing: Float = DefaultLabelDiameterScale, holeSize: Float = 0.0f, holeContent: @Composable () -> Unit = {}, minPieDiameter: Dp = 100.dp, maxPieDiameter: Dp = 300.dp, forceCenteredPie: Boolean = false, animationSpec: AnimationSpec<Float> = KoalaPlotTheme.animationSpec)

Creates a Pie Chart or, optionally, a Donut Chart if holeSize is nonZero, with optional hole content to place at the center of the donut hole. Pie slices are drawn starting at -90 degrees (top center), progressing clockwise around the pie. Each slice occupies a fraction of the overall pie according to its data value relative to the sum of all values.

Link copied to clipboard
fun LabelConnectorScope.StraightLineConnector(modifier: Modifier = Modifier, connectorColor: Color = MaterialTheme.colorScheme.onBackground, connectorStroke: Stroke = Stroke(width = 1f))

A label connector that uses a straight line.