mirror of
https://github.com/vide/matedroid.git
synced 2026-01-20 00:03:17 +08:00
feat: show total kWh instead of charge count in histograms
The charges screen histograms now display total energy charged (kWh) per day/week/month instead of the number of charging sessions. This is more useful for users with smart charging systems (like Octopus) that optimize costs by splitting charging into multiple partial sessions. Fixes #18 Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
@@ -606,9 +606,9 @@ private fun ChargesChart(
|
||||
palette: CarColorPalette
|
||||
) {
|
||||
val title = when (granularity) {
|
||||
ChartGranularity.DAILY -> "Charges per Day"
|
||||
ChartGranularity.WEEKLY -> "Charges per Week"
|
||||
ChartGranularity.MONTHLY -> "Charges per Month"
|
||||
ChartGranularity.DAILY -> "Energy per Day"
|
||||
ChartGranularity.WEEKLY -> "Energy per Week"
|
||||
ChartGranularity.MONTHLY -> "Energy per Month"
|
||||
}
|
||||
|
||||
Card(
|
||||
@@ -641,8 +641,8 @@ private fun ChargesChart(
|
||||
val barData = chartData.map { data ->
|
||||
BarChartData(
|
||||
label = data.label,
|
||||
value = data.count.toDouble(),
|
||||
displayValue = "${data.count} charges"
|
||||
value = data.totalEnergy,
|
||||
displayValue = "%.1f kWh".format(data.totalEnergy)
|
||||
)
|
||||
}
|
||||
|
||||
@@ -655,7 +655,7 @@ private fun ChargesChart(
|
||||
barColor = palette.accent,
|
||||
labelColor = palette.onSurfaceVariant,
|
||||
showEveryNthLabel = labelInterval,
|
||||
valueFormatter = { "%.0f charges".format(it) }
|
||||
valueFormatter = { "%.1f kWh".format(it) }
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user