mirror of
https://github.com/SyncrowIOT/web.git
synced 2026-10-25 10:07:56 +00:00
modify data to migrate to days instead of months.
This commit is contained in:
+2
-3
@@ -1,7 +1,6 @@
|
||||
import 'package:fl_chart/fl_chart.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:syncrow_web/pages/analytics/helpers/format_number_to_kwh.dart';
|
||||
import 'package:syncrow_web/pages/analytics/helpers/get_month_name_from_int.dart';
|
||||
import 'package:syncrow_web/utils/color_manager.dart';
|
||||
import 'package:syncrow_web/utils/extension/build_context_x.dart';
|
||||
|
||||
@@ -25,7 +24,7 @@ abstract final class EnergyManagementChartsHelper {
|
||||
getTitlesWidget: (value, meta) => Padding(
|
||||
padding: const EdgeInsetsDirectional.only(top: 20.0),
|
||||
child: Text(
|
||||
(value + 1).getMonthName,
|
||||
value.toString(),
|
||||
style: context.textTheme.bodySmall?.copyWith(
|
||||
color: ColorsManager.greyColor,
|
||||
fontSize: 12,
|
||||
@@ -62,7 +61,7 @@ abstract final class EnergyManagementChartsHelper {
|
||||
}
|
||||
|
||||
static String getToolTipLabel(num month, double value) {
|
||||
final monthLabel = month.getMonthName;
|
||||
final monthLabel = month.toString();
|
||||
final valueLabel = value.formatNumberToKwh;
|
||||
final labels = [monthLabel, valueLabel];
|
||||
return labels.where((element) => element.isNotEmpty).join(', ');
|
||||
|
||||
+1
-1
@@ -25,7 +25,7 @@ class EnergyConsumptionPerDeviceChart extends StatelessWidget {
|
||||
spots: e.energy
|
||||
.map(
|
||||
(energy) => FlSpot(
|
||||
energy.date.month.toDouble(),
|
||||
energy.date.day.toDouble(),
|
||||
energy.value,
|
||||
),
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user