This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@Composable | |
fun PieChart( | |
data: Map<String, Int>, | |
radiusOuter: Dp = 140.dp, | |
chartBarWidth: Dp = 35.dp, | |
animDuration: Int = 1000, | |
) { | |
val totalSum = data.values.sum() | |
val floatValue = mutableListOf<Float>() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@Composable | |
fun BarGraph( | |
graphBarData: List<Float>, | |
xAxisScaleData: List<Int>, | |
barData_: List<Int>, | |
height: Dp, | |
roundType: BarType, | |
barWidth: Dp, | |
barColor: Color, | |
barArrangement: Arrangement.Horizontal |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// graph | |
barValue.forEach { | |
Box( | |
modifier = Modifier | |
.padding(start = barGraphWidth, bottom = 5.dp) | |
.clip(CircleShape) | |
.width(barGraphWidth) | |
.fillMaxHeight(it) | |
.background(Purple500) | |
.clickable { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@Composable | |
fun CustomChart( | |
barValue: List<Float>, | |
xAxisScale: List<String>, | |
total_amount: Int | |
) { | |
val context = LocalContext.current | |
// BarGraph Dimensions | |
val barGraphHeight by remember { mutableStateOf(200.dp) } | |
val barGraphWidth by remember { mutableStateOf(20.dp) } |