2.3 KiB
2.3 KiB
PointChart
To use the PointChart, follow the steps below:
- Include the Charty library in your Android project.
- Use the
PointChartcomposable in your code:
Function Signature
@Composable
fun PointChart(
pointData: ChartDataCollection,
contentColor: Color,
modifier: Modifier = Modifier,
backgroundColor: Color = Color.White,
padding: Dp = 16.dp,
pointType: PointType = PointType.Stroke(),
axisConfig: AxisConfig = ChartDefaults.axisConfigDefaults(),
radiusScale: Float = 0.02f,
)
Additional Function Signature
@Composable
fun PointChart(
dataCollection: ChartDataCollection,
modifier: Modifier = Modifier,
padding: Dp = 16.dp,
pointType: PointType = PointType.Stroke(),
axisConfig: AxisConfig = ChartDefaults.axisConfigDefaults(),
radiusScale: Float = 0.02f,
chartColors: ChartColors = ChartDefaults.colorDefaults(),
)
Parameters
dataCollection: This parameter is of typeChartDataCollectionand represents the data that will be plotted on the chart. It contains a collection ofPointData.modifier: This parameter is of typeModifierand is used to modify the appearance or behavior of the chart.backgroundColor: This parameter is of typeColorand represents the background color of the chart. The default value isColor.White.padding: This parameter is of typeDpand represents the padding around the chart. The default value is16.dp.pointType: This parameter is of typePointTypeand represents the type of point rendering on the chart. It can be eitherPointType.Stroke()(hollow points) orPointType.Fill()(filled points). The default value isPointType.Stroke().axisConfig: This parameter is of typeAxisConfigand allows customization of the axis appearance and labels on the chart. The default value isChartDefaults.axisConfigDefaults().radiusScale: This parameter is of typeFloatand represents the scale factor for the radius of the data points on the chart. The default value is0.02f.contentColor: This parameter is of typeColor.chartColors: This parameter is of typeChartColorsand allows customization of the chart's colors. The default value isChartDefaults.colorDefaults().