mirror of
https://github.com/SyncrowIOT/syncrow-app.git
synced 2025-07-16 18:16:21 +00:00
power_chart_changes
This commit is contained in:
@ -22,7 +22,6 @@ class _EnergyConsumptionPageState extends State<EnergyConsumptionPage> {
|
||||
|
||||
@override
|
||||
void initState() {
|
||||
// Use the provided data
|
||||
_chartData = widget.chartData;
|
||||
super.initState();
|
||||
}
|
||||
@ -65,17 +64,9 @@ class _EnergyConsumptionPageState extends State<EnergyConsumptionPage> {
|
||||
bottomTitles: AxisTitles(
|
||||
sideTitles: SideTitles(
|
||||
showTitles: false,
|
||||
getTitlesWidget: (value, meta) {
|
||||
int index = value.toInt();
|
||||
if (index >= 0 && index < _chartData.length) {
|
||||
return Text(_chartData[index].time,
|
||||
style: TextStyle(fontSize: 10));
|
||||
}
|
||||
return const SizedBox.shrink();
|
||||
},
|
||||
),
|
||||
),
|
||||
leftTitles: AxisTitles(
|
||||
leftTitles: const AxisTitles(
|
||||
sideTitles: SideTitles(
|
||||
showTitles: false,
|
||||
),
|
||||
@ -83,11 +74,6 @@ class _EnergyConsumptionPageState extends State<EnergyConsumptionPage> {
|
||||
rightTitles: AxisTitles(
|
||||
sideTitles: SideTitles(
|
||||
showTitles: false,
|
||||
reservedSize: 40,
|
||||
getTitlesWidget: (value, meta) {
|
||||
return Text(value.toStringAsFixed(1) + ' kWh',
|
||||
style: TextStyle(fontSize: 10));
|
||||
},
|
||||
),
|
||||
),
|
||||
topTitles: AxisTitles(
|
||||
@ -118,8 +104,8 @@ class _EnergyConsumptionPageState extends State<EnergyConsumptionPage> {
|
||||
verticalInterval: 1,
|
||||
getDrawingVerticalLine: (value) {
|
||||
return FlLine(
|
||||
color: Colors.blue.withOpacity(0.2),
|
||||
dashArray: [10, 10],
|
||||
color: Colors.grey.withOpacity(0.2),
|
||||
dashArray: [8, 8],
|
||||
strokeWidth: 1,
|
||||
);
|
||||
},
|
||||
@ -134,7 +120,6 @@ class _EnergyConsumptionPageState extends State<EnergyConsumptionPage> {
|
||||
),
|
||||
lineBarsData: [
|
||||
LineChartBarData(
|
||||
|
||||
curveSmoothness: 0.5,
|
||||
preventCurveOverShooting: true,
|
||||
aboveBarData: BarAreaData(),
|
||||
@ -164,7 +149,6 @@ class _EnergyConsumptionPageState extends State<EnergyConsumptionPage> {
|
||||
),
|
||||
isStrokeCapRound: true,
|
||||
barWidth: 6,
|
||||
|
||||
),
|
||||
],
|
||||
borderData: FlBorderData(
|
||||
|
Reference in New Issue
Block a user