I am designing a bar chart in Compose using the Vico bar chart library.
Currently, my code looks like the following and shows the same color for every column.
CartesianChartHost(
chart = rememberCartesianChart(
rememberColumnCartesianLayer(
ColumnCartesianLayer.ColumnProvider.series(
rememberLineComponent(
color = Color(0xFF00B7C2),
thickness = 8.dp,
shape = CorneredShape.rounded(topLeftPercent = 50, topRightPercent = 50),
)
),
columnCollectionSpacing = 16.dp,
rangeProvider = rangeProvider
),
startAxis = VerticalAxis.rememberStart(),
bottomAxis = HorizontalAxis.rememberBottom(
valueFormatter = getBottomAxisValueFormatter(
chartType = chartType, daysInMonth = daysInMonth
),
itemPlacer = remember {
HorizontalAxis.ItemPlacer.aligned(spacing = 1, addExtremeLabelPadding = true)
},
),
marker = rememberMarker(),
decorations = listOf(rememberComposeHorizontalLine(target))
), model = model, modifier = modifier
.padding(8.dp)
.fillMaxSize()
)
Can I set different colors for each column?