1.6 KiB
1.6 KiB
BubbleChart
To use the BubbleChart, follow the steps below:
- Include the Charty library in your Android project.
- Use the
BubbleChartcomposable in your code:
fun BubbleChart(
dataCollection: ChartDataCollection,
modifier: Modifier = Modifier,
padding: Dp = 16.dp,
axisConfig: AxisConfig = ChartDefaults.axisConfigDefaults(),
chartColors: CurvedLineChartColors = CurvedLineChartDefaults.defaultColor(),
) {
// Implementation details...
}
Parameters
BubbleChart accepts the following parameters:
dataCollection: AChartDataCollectionobject representing the data to be displayed in bubble chart of typeBubbleData.modifier: OptionalModifierto customize the appearance and behavior of the chart.padding: OptionalDpvalue representing the padding around the chart. Default is16.dp.chartColors: OptionalCurvedLineChartColorsvalue representing the color used in the chart. where it looks like,
data class CurvedLineChartColors(
val dotColor: List<Color> = emptyList(),
val backgroundColors: List<Color> = emptyList(),
val contentColor: List<Color> = emptyList(),
)
axisConfig: OptionalAxisConfigobject representing the configuration of the chart axes. Default isChartDefaults.axisConfigDefaults().
Where, AxisConfig looks like,
data class AxisConfig(
val showAxes: Boolean,
val showGridLines: Boolean,
val showGridLabel: Boolean,
val axisStroke: Float,
val minLabelCount: Int,
val axisColor: Color,
val gridColor: Color = axisColor.copy(alpha = 0.5F),
)