Код: Выделить всё
type here. LaunchedEffect(Unit) {
withContext(Dispatchers.Default) {
while (isActive) {
modelProducer.tryRunTransaction {
columnSeries {
repeat(Defaults.MULTI_SERIES_COUNT) {
series(
List(Defaults.ENTRY_COUNT) {
Defaults.COLUMN_LAYER_MIN_Y +
Random.nextFloat() * Defaults.COLUMN_LAYER_RELATIVE_MAX_Y
}
)
}
}
}
delay(Defaults.TRANSACTION_INTERVAL_MS)
}
}
}
CartesianChartHost(
chart =
rememberCartesianChart(
rememberColumnCartesianLayer(
ColumnCartesianLayer.ColumnProvider.series(
columnColors.map {
rememberLineComponent(
color = it,
thickness = 8.dp,
shape = shape
)
}
)
),
startAxis = rememberStartAxis(
label = rememberAxisLabelComponent(
color = Color.Black,
textSize = MaterialTheme.typography.bodyMedium.fontSize
)
),
bottomAxis = rememberBottomAxis(
label = rememberAxisLabelComponent(
color = Color.Black
)
),
decorations = remember(horizontalBox) { listOf(horizontalBox) },
),
modelProducer = modelProducer,
marker = rememberMarker(),
runInitialAnimation = false,
zoomState = rememberVicoZoomState(zoomEnabled = true),
)
}
}
}
Подробнее здесь: https://stackoverflow.com/questions/787 ... ck-compose