We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
maxBarValue
1 parent 06a4fc7 commit 64abab8Copy full SHA for 64abab8
app/src/main/java/me/bytebeats/views/charts/app/ui/screen/bar/BarChartDataModel.kt
@@ -75,15 +75,16 @@ class BarChartDataModel {
75
}
76
77
internal fun addBar() {
78
- barChartData = barChartData.copy(bars = bars.toMutableList().apply {
+ val newBars = bars.toMutableList().apply {
79
add(
80
BarChartData.Bar(
81
label = "Bar ${bars.size + 1}",
82
value = randomValue(),
83
color = randomColor()
84
)
85
86
- }.toList())
+ }.toList()
87
+ barChartData = barChartData.copy(bars = newBars, maxBarValue = newBars.maxOf { it.value })
88
89
90
internal fun removeBar() {
0 commit comments