mirror of
https://github.com/SyncrowIOT/web.git
synced 2025-07-10 07:07:19 +00:00
Refactor chart data generation in EnergyConsumptionPerDeviceChart for improved readability and maintainability
This commit is contained in:
@ -15,37 +15,15 @@ class EnergyConsumptionPerDeviceChart extends StatelessWidget {
|
||||
lineTouchData: EnergyManagementChartsHelper.lineTouchData(),
|
||||
lineBarsData: [
|
||||
_buildChartBar(
|
||||
spots: const [
|
||||
FlSpot(1, 100),
|
||||
FlSpot(2, 200),
|
||||
FlSpot(3, 300),
|
||||
FlSpot(4, 400),
|
||||
FlSpot(5, 500),
|
||||
FlSpot(6, 600),
|
||||
FlSpot(7, 700),
|
||||
FlSpot(8, 800),
|
||||
FlSpot(9, 900),
|
||||
FlSpot(10, 1000),
|
||||
FlSpot(11, 1100),
|
||||
FlSpot(12, 1200),
|
||||
spots: [
|
||||
for (var i = 0; i < 12; i++) FlSpot(i.toDouble(), (i + 1) * 100),
|
||||
],
|
||||
color: Colors.amber,
|
||||
),
|
||||
_buildChartBar(
|
||||
color: Colors.red,
|
||||
spots: const [
|
||||
FlSpot(1, 100),
|
||||
FlSpot(2, 300),
|
||||
FlSpot(3, 400),
|
||||
FlSpot(4, 500),
|
||||
FlSpot(5, 600),
|
||||
FlSpot(6, 700),
|
||||
FlSpot(7, 800),
|
||||
FlSpot(8, 900),
|
||||
FlSpot(9, 1000),
|
||||
FlSpot(10, 1100),
|
||||
FlSpot(11, 1200),
|
||||
FlSpot(12, 1300),
|
||||
spots: [
|
||||
for (var i = 0; i < 12; i++) FlSpot(i.toDouble(), (i + 1) * 110),
|
||||
],
|
||||
),
|
||||
],
|
||||
|
Reference in New Issue
Block a user