Skip to content

Commit 33320a0

Browse files
committed
调整颜色
1 parent a37f61e commit 33320a0

File tree

5 files changed

+25
-11
lines changed

5 files changed

+25
-11
lines changed

.idea/misc.xml

-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

build.gradle.kts

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ val appName = "StopBonus"
1414
val appPackage = "love.forte.bonus"
1515
val appMenuGroup = "forteApp"
1616
val appNameWithPackage = "$appPackage.$appName"
17-
val appVersion = "1.0.10"
17+
val appVersion = "1.0.11"
1818

1919
group = appPackage
2020
version = appVersion

src/main/kotlin/view/account/stats/MonthDailyModeStats.kt

+3-3
Original file line numberDiff line numberDiff line change
@@ -247,7 +247,7 @@ class MonthDailyModeStats(private val monthDailyModeState: MonthDailyModeState)
247247
barWidth = 0.65f,
248248
bar = { index ->
249249
DefaultVerticalBar(
250-
brush = SolidColor(Color.Blue),
250+
brush = SolidColor(StatsColors.firstColor),
251251
shape = RoundedCornerShape(topStartPercent = 35, topEndPercent = 35),
252252
hoverElement = {
253253
ElevatedCard(
@@ -275,8 +275,8 @@ class MonthDailyModeStats(private val monthDailyModeState: MonthDailyModeState)
275275
}
276276

277277
private val chartColors = arrayOf(
278-
Color.Red,
279-
Color.Blue
278+
StatsColors.firstColor,
279+
StatsColors.secondColor
280280
)
281281

282282
@OptIn(ExperimentalKoalaPlotApi::class, ExperimentalFoundationApi::class)
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
package view.account.stats
2+
3+
import androidx.compose.ui.graphics.Color
4+
5+
@Suppress("MemberVisibilityCanBePrivate")
6+
object StatsColors {
7+
val colors = arrayOf(
8+
Color(79, 155, 166),
9+
Color(39, 76, 78),
10+
)
11+
12+
val firstColor = colors[0]
13+
val secondColor = colors[1]
14+
}

src/main/kotlin/view/account/stats/YearMonthlyModeStats.kt

+7-6
Original file line numberDiff line numberDiff line change
@@ -27,11 +27,9 @@ import io.github.koalaplot.core.util.ExperimentalKoalaPlotApi
2727
import io.github.koalaplot.core.xygraph.CategoryAxisModel
2828
import io.github.koalaplot.core.xygraph.XYGraph
2929
import io.github.koalaplot.core.xygraph.rememberLinearAxisModel
30-
import org.jetbrains.exposed.sql.and
31-
import org.jetbrains.exposed.sql.count
30+
import org.jetbrains.exposed.sql.*
3231
import org.jetbrains.exposed.sql.javatime.month
3332
import org.jetbrains.exposed.sql.javatime.year
34-
import org.jetbrains.exposed.sql.sum
3533
import view.account.PageViewState
3634
import view.account.record.format
3735
import java.time.*
@@ -187,6 +185,7 @@ class YearMonthlyModeStats(private val yearMonthlyModeState: YearMonthlyModeStat
187185

188186
LaunchedEffect(type, year) {
189187
state.accountState.inAccountTransaction { account ->
188+
addLogger(StdOutSqlLogger)
190189
// 根据年查询所有数据,并按月统计
191190
// 数据:年月 / 次数
192191

@@ -211,6 +210,8 @@ class YearMonthlyModeStats(private val yearMonthlyModeState: YearMonthlyModeStat
211210
val year = row[stYear]
212211
val month = row[stMonth]
213212

213+
println("year=$year, month=$month, count=$count")
214+
214215
DataRow(YearMonth.of(year, month), count)
215216
}.associate { it.yearMonth to it.count }
216217

@@ -253,7 +254,7 @@ class YearMonthlyModeStats(private val yearMonthlyModeState: YearMonthlyModeStat
253254
barWidth = 0.65f,
254255
bar = { index ->
255256
DefaultVerticalBar(
256-
brush = SolidColor(Color.Blue),
257+
brush = SolidColor(StatsColors.firstColor),
257258
shape = RoundedCornerShape(topStartPercent = 35, topEndPercent = 35),
258259
hoverElement = {
259260
ElevatedCard(
@@ -286,8 +287,8 @@ class YearMonthlyModeStats(private val yearMonthlyModeState: YearMonthlyModeStat
286287
}
287288

288289
private val chartColors = arrayOf(
289-
Color.Red,
290-
Color.Blue
290+
StatsColors.firstColor,
291+
StatsColors.secondColor
291292
)
292293

293294
@OptIn(ExperimentalKoalaPlotApi::class)

0 commit comments

Comments
 (0)