Skip to content
Snippets Groups Projects
Commit 5df3ade6 authored by Sara Savanovic Djordjevic's avatar Sara Savanovic Djordjevic
Browse files

update: even better chart appearance

parent 44c28c77
No related branches found
No related tags found
1 merge request!11Clhp map
...@@ -98,9 +98,7 @@ class _BarDataState extends State<BarData> { ...@@ -98,9 +98,7 @@ class _BarDataState extends State<BarData> {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return Padding( return Column(
padding: const EdgeInsets.only(top: 16),
child: Column(
children: [ children: [
SizedBox( SizedBox(
width: MediaQuery.of(context).size.width, // Set the desired width width: MediaQuery.of(context).size.width, // Set the desired width
...@@ -164,7 +162,6 @@ class _BarDataState extends State<BarData> { ...@@ -164,7 +162,6 @@ class _BarDataState extends State<BarData> {
), ),
), ),
], ],
),
); );
} }
} }
\ No newline at end of file
...@@ -217,49 +217,57 @@ class _MapContainerWidgetState extends State<MapContainerWidget> { ...@@ -217,49 +217,57 @@ class _MapContainerWidgetState extends State<MapContainerWidget> {
], ],
), ),
const SizedBox(height: contPadding), // Padding between containers const SizedBox(height: contPadding), // Padding between containers
ClipRRect( Column(
borderRadius: BorderRadius.circular(20), crossAxisAlignment: CrossAxisAlignment.start,
child: SizedBox( children: [
SizedBox(
width: screenWidth * boxWidth,
child: Align(
alignment: Alignment.topLeft,
child: Padding(
padding: const EdgeInsets.only(top: 20, left: 30), // Updated padding
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(
'Ice stats',
style: titleStyle,
),
const Divider(),
const SizedBox(height: 10), // Reduced padding
Text(
'Measured at ',
style: subHeadingStyle,
),
Text(
'Date: ${(selectedTile?.timeMeasured.day ?? '-')}/${(selectedTile?.timeMeasured.month ?? '-')}/${(selectedTile?.timeMeasured.year ?? '-')}',
style: regTextStyle,
),
Text(
'Time: ${selectedTile?.timeMeasured.hour}:00',
style: regTextStyle,
),
],
),
),
),
),
const SizedBox(height: contPadding*2),
SizedBox(
width: screenWidth * boxWidth * 1.2, width: screenWidth * boxWidth * 1.2,
height: screenWidth * boxHeight * 1.5, // NB: make dynamic child: Center(
child: Align( child: Text(
alignment: Alignment.topLeft, 'Measuring point: (${selectedTile?.measurementID}, ${selectedTile?.measurementID})',
child: Padding( style: regTextStyle,
padding: const EdgeInsets.only(top: 20, left: 20), // Edge padding, text
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(
'Ice stats',
style: titleStyle,
),
const Divider(),
const Padding(padding: EdgeInsets.all(10)),
Text(
'Measured at ',
style: subHeadingStyle,
),
Text(
'Date: ${(selectedTile?.timeMeasured.day ?? '-')}/${(selectedTile?.timeMeasured.month ?? '-')}/${(selectedTile?.timeMeasured.year ?? '-')}',
style: regTextStyle,
),
Text(
'Time: ${selectedTile?.timeMeasured.hour}:00',
style: regTextStyle,
),
const SizedBox(height: contPadding),
Text(
'Measuring point: (${selectedTile?.measurementID}, ${selectedTile?.measurementID})',
style: regTextStyle,
),
const SizedBox(height: contPadding),
const SizedBox(height: 15),
const StatCharts(),
],
), ),
), ),
), ),
), SizedBox(
width: screenWidth * boxWidth * 1.2,
height: screenWidth * boxHeight * 1.5,
child: const StatCharts(),
)
],
), ),
], ],
); );
......
...@@ -64,70 +64,6 @@ class StatCharts extends StatelessWidget { ...@@ -64,70 +64,6 @@ class StatCharts extends StatelessWidget {
); );
} }
Widget buildBarChart(BuildContext context) {
return Padding(
padding: const EdgeInsets.only(right: 20),
child: BarChart(
BarChartData(
alignment: BarChartAlignment.spaceAround,
maxY: 20,
barTouchData: BarTouchData(enabled: false),
backgroundColor: Colors.grey.shade800,
titlesData: FlTitlesData(
bottomTitles: SideTitles(
showTitles: true,
getTextStyles: (value) => const TextStyle(color: Colors.white60),
margin: 10,
getTitles: (value) {
switch (value.toInt()) {
case 0:
return 'Value';
case 1:
return 'Value';
case 2:
return 'Value';
default:
return '';
}
},
),
leftTitles: SideTitles(
showTitles: true,
getTextStyles: (value) => const TextStyle(color: Colors.white60),
margin: 10,
reservedSize: 30,
interval: 5,
),
),
borderData: FlBorderData(
show: true,
border: Border.all(color: Colors.white60, width: 1),
),
barGroups: [
BarChartGroupData(
x: 0,
barRods: [
BarChartRodData(y: 15, width: 10),
],
),
BarChartGroupData(
x: 1,
barRods: [
BarChartRodData(y: 10, width: 10),
],
),
BarChartGroupData(
x: 2,
barRods: [
BarChartRodData(y: 18, width: 10),
],
),
],
),
),
);
}
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return Column( return Column(
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment