1.9 KiB
1.9 KiB
CircleChart
To use the CircleChart, follow the steps below:
- Include the Charty library in your Android project.
- Use the
CircleChartcomposable in your code:
fun CircleChart(
dataCollection: ChartDataCollection,
modifier: Modifier = Modifier,
canAnimate: Boolean = true,
textLabelTextConfig: CircleChartLabelTextConfig = CircleConfigDefaults.defaultTextLabelConfig(),
config: CircleChartConfig = CircleConfigDefaults.circleConfigDefaults(),
) {
// Implementation details...
}
Parameters
CircleChart accepts the following parameters:
dataCollection: AChartDataCollectionobject representing the data to be displayed in CircleChart of typeCircleData.modifier: OptionalModifierto customize the appearance and behavior of the chart.canAnimate: OptionalBooleanvalue representing if the chart should animate. Default istrue.textLabelTextConfig: OptionalCircleChartLabelTextConfigtype parameter. Configuration for the text label that appears in the center of the chart. Default configuration can be accessed throughCircleConfigDefaults.defaultTextLabelConfig(). where, it looks like,
data class CircleChartLabelTextConfig(
val textSize: TextUnit,
val fontStyle: FontStyle? = null,
val fontWeight: FontWeight? = null,
val fontFamily: FontFamily? = null,
val indicatorSize: Dp = 10.dp,
val maxLine: Int = 1,
val overflow: TextOverflow = TextOverflow.Ellipsis
)
config: OptionalCircleChartConfigtype parameter. Configuration for the circle chart appearance. Default configuration can be accessed through CircleConfigDefaults.circleConfigDefaults(). where, it looks like,
data class CircleChartConfig(
val startAngle: StartAngle = StartAngle.Zero,
val maxValue: Float?,
val showLabel: Boolean
)