mirror of
https://github.com/SyncrowIOT/web.git
synced 2025-07-10 15:17:31 +00:00
SP-1506 rework
Remove extra line. The colors of the data on X axis and Y axis are not identical to design. Display days only on the X axis. When the bar chart loads, we see it coming from the top (check the attached video).
This commit is contained in:
@ -74,6 +74,7 @@ class AnalyticsPageTabsAndChildren extends StatelessWidget {
|
|||||||
FetchEnergyManagementDataHelper
|
FetchEnergyManagementDataHelper
|
||||||
.loadEnergyManagementData(
|
.loadEnergyManagementData(
|
||||||
context,
|
context,
|
||||||
|
shouldFetchAnalyticsDevices: false,
|
||||||
selectedDate: value,
|
selectedDate: value,
|
||||||
communityId:
|
communityId:
|
||||||
spaceTreeState.selectedCommunities.firstOrNull ??
|
spaceTreeState.selectedCommunities.firstOrNull ??
|
||||||
|
@ -26,6 +26,7 @@ abstract final class FetchEnergyManagementDataHelper {
|
|||||||
required String communityId,
|
required String communityId,
|
||||||
required String spaceId,
|
required String spaceId,
|
||||||
DateTime? selectedDate,
|
DateTime? selectedDate,
|
||||||
|
bool shouldFetchAnalyticsDevices = true,
|
||||||
}) {
|
}) {
|
||||||
if (communityId.isEmpty && spaceId.isEmpty) {
|
if (communityId.isEmpty && spaceId.isEmpty) {
|
||||||
clearAllData(context);
|
clearAllData(context);
|
||||||
@ -34,12 +35,16 @@ abstract final class FetchEnergyManagementDataHelper {
|
|||||||
|
|
||||||
final datePickerState = context.read<AnalyticsDatePickerBloc>().state;
|
final datePickerState = context.read<AnalyticsDatePickerBloc>().state;
|
||||||
final selectedDate0 = selectedDate ?? datePickerState.monthlyDate;
|
final selectedDate0 = selectedDate ?? datePickerState.monthlyDate;
|
||||||
loadAnalyticsDevices(
|
if (shouldFetchAnalyticsDevices) {
|
||||||
context,
|
loadAnalyticsDevices(
|
||||||
communityUuid: communityId,
|
context,
|
||||||
spaceUuid: spaceId,
|
communityUuid: communityId,
|
||||||
selectedDate: selectedDate0,
|
spaceUuid: spaceId,
|
||||||
);
|
selectedDate: selectedDate0,
|
||||||
|
);
|
||||||
|
loadRealtimeDeviceChanges(context);
|
||||||
|
loadPowerClampInfo(context);
|
||||||
|
}
|
||||||
loadTotalEnergyConsumption(
|
loadTotalEnergyConsumption(
|
||||||
context,
|
context,
|
||||||
selectedDate: selectedDate0,
|
selectedDate: selectedDate0,
|
||||||
@ -60,8 +65,6 @@ abstract final class FetchEnergyManagementDataHelper {
|
|||||||
spaceId: spaceId,
|
spaceId: spaceId,
|
||||||
selectedDate: selectedDate0,
|
selectedDate: selectedDate0,
|
||||||
);
|
);
|
||||||
loadRealtimeDeviceChanges(context);
|
|
||||||
loadPowerClampInfo(context);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static void loadEnergyConsumptionByPhases(
|
static void loadEnergyConsumptionByPhases(
|
||||||
|
@ -56,7 +56,7 @@ class EnergyConsumptionByPhasesChart extends StatelessWidget {
|
|||||||
ColorsManager.vividBlue.withValues(alpha: 0.15),
|
ColorsManager.vividBlue.withValues(alpha: 0.15),
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
width: 16,
|
width: 8,
|
||||||
borderRadius: const BorderRadius.only(
|
borderRadius: const BorderRadius.only(
|
||||||
topLeft: Radius.circular(8),
|
topLeft: Radius.circular(8),
|
||||||
topRight: Radius.circular(8),
|
topRight: Radius.circular(8),
|
||||||
@ -66,6 +66,7 @@ class EnergyConsumptionByPhasesChart extends StatelessWidget {
|
|||||||
);
|
);
|
||||||
}).toList(),
|
}).toList(),
|
||||||
),
|
),
|
||||||
|
duration: Duration.zero,
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -160,9 +161,9 @@ class EnergyConsumptionByPhasesChart extends StatelessWidget {
|
|||||||
sideTitles: SideTitles(
|
sideTitles: SideTitles(
|
||||||
showTitles: true,
|
showTitles: true,
|
||||||
getTitlesWidget: (value, _) {
|
getTitlesWidget: (value, _) {
|
||||||
final month = DateFormat('dd/MM').format(energyData[value.toInt()].date);
|
final month = DateFormat('d').format(energyData[value.toInt()].date);
|
||||||
return FittedBox(
|
return FittedBox(
|
||||||
alignment: AlignmentDirectional.bottomCenter,
|
alignment: AlignmentDirectional.center,
|
||||||
fit: BoxFit.scaleDown,
|
fit: BoxFit.scaleDown,
|
||||||
child: RotatedBox(
|
child: RotatedBox(
|
||||||
quarterTurns: 3,
|
quarterTurns: 3,
|
||||||
@ -176,7 +177,7 @@ class EnergyConsumptionByPhasesChart extends StatelessWidget {
|
|||||||
),
|
),
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
reservedSize: 36,
|
reservedSize: 18,
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user