1.3 KiB
1.3 KiB
PieChart
To use the PieChart, follow the steps below:
- Include the Charty library in your Android project.
- Use the
PieChartcomposable in your code:
@Composable
fun PieChart(
dataCollection: ChartDataCollection,
modifier: Modifier = Modifier,
textLabelTextConfig: ChartyLabelTextConfig = ChartDefaults.defaultTextLabelConfig(),
pieChartConfig: PieChartConfig = PieChartDefaults.defaultConfig(),
)
Parameters
dataCollection: This parameter is of typeChartDataCollectionand represents the data that will be plotted on the chart. It contains a collection ofPieData.modifier: This parameter is of typeModifierand is used to modify the appearance or behavior of the chart.textLabelTextConfig: This parameter is of typeChartyLabelTextConfigand allows customization of the labels displayed inside the chart. It provides options to configure the text appearance, such as color, size, and style.pieChartConfig: This parameter is of typePieChartConfigand allows customization of the pie chart appearance and behavior.It looks like,
data class PieChartConfig(
val donut: Boolean,
val showLabel: Boolean,
val startAngle: StartAngle = StartAngle.Zero
)