mirror of
https://github.com/SyncrowIOT/web.git
synced 2025-07-11 07:38:05 +00:00
fixes in OccupancyChart
for a more pleasant UI.
This commit is contained in:
@ -33,6 +33,7 @@ class OccupancyChart extends StatelessWidget {
|
|||||||
),
|
),
|
||||||
barGroups: List.generate(chartData.length, (index) {
|
barGroups: List.generate(chartData.length, (index) {
|
||||||
final actual = chartData[index];
|
final actual = chartData[index];
|
||||||
|
final occupancyValue = double.parse(actual.occupancy);
|
||||||
return BarChartGroupData(
|
return BarChartGroupData(
|
||||||
x: index,
|
x: index,
|
||||||
barsSpace: 0,
|
barsSpace: 0,
|
||||||
@ -40,13 +41,13 @@ class OccupancyChart extends StatelessWidget {
|
|||||||
barRods: [
|
barRods: [
|
||||||
BarChartRodData(
|
BarChartRodData(
|
||||||
toY: 100.0,
|
toY: 100.0,
|
||||||
fromY: double.parse(actual.occupancy) + 2.5,
|
fromY: occupancyValue == 0 ? occupancyValue : occupancyValue + 2.5,
|
||||||
color: ColorsManager.graysColor,
|
color: ColorsManager.graysColor,
|
||||||
width: _chartWidth,
|
width: _chartWidth,
|
||||||
borderRadius: BorderRadius.circular(10),
|
borderRadius: BorderRadius.circular(10),
|
||||||
),
|
),
|
||||||
BarChartRodData(
|
BarChartRodData(
|
||||||
toY: double.parse(actual.occupancy),
|
toY: occupancyValue,
|
||||||
color: ColorsManager.vividBlue.withValues(alpha: 0.8),
|
color: ColorsManager.vividBlue.withValues(alpha: 0.8),
|
||||||
width: _chartWidth,
|
width: _chartWidth,
|
||||||
borderRadius: BorderRadius.circular(10),
|
borderRadius: BorderRadius.circular(10),
|
||||||
|
Reference in New Issue
Block a user