1.5 KiB
1.5 KiB
StackedBarChart
To use the StackedBarChart, follow the steps below:
- Include the Charty library in your Android project.
- Use the
StackedBarChartcomposable in your code:
Function Signature
@Composable
fun StackedBarChart(
stackBarData: ComposeList<StackBarData>,
modifier: Modifier = Modifier,
axisConfig: AxisConfig = ChartDefaults.axisConfigDefaults(),
padding: Dp = 16.dp,
spacing: Dp = 4.dp,
textLabelTextConfig: ChartyLabelTextConfig = ChartDefaults.defaultTextLabelConfig(),
)
Parameters
stackBarData: This parameter is of typeComposeList<StackBarData>and represents the data that will be plotted on the stacked bar chart. It contains a list ofStackBarDataobjects.modifier: This parameter is of typeModifier.axisConfig: This parameter is of typeAxisConfigand allows customization of the axis appearance and labels on the chart. It provides options to configure the axis color, stroke width, and label count, among others. The default value isChartDefaults.axisConfigDefaults().padding: This parameter is of typeDpand represents the padding around the chart. The default value is16.dp.spacing: This parameter is of typeDpand represents the spacing between the stacked bars. The default value is4.dp.textLabelTextConfig: This parameter is of typeChartyLabelTextConfigand allows customization of the text labels on the chart. The default value isChartDefaults.defaultTextLabelConfig().