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

fix: chart centering

parent 8cc8b064
No related branches found
No related tags found
1 merge request!10Clhp map
......@@ -5,7 +5,9 @@ class StatCharts extends StatelessWidget {
const StatCharts({Key? key}) : super(key: key);
Widget buildLineChart(BuildContext context) {
return LineChart(
return Padding(
padding: const EdgeInsets.only(right: 17),
child: LineChart(
LineChartData(
backgroundColor: Colors.grey.shade800,
titlesData: FlTitlesData(
......@@ -57,11 +59,14 @@ class StatCharts extends StatelessWidget {
),
],
),
),
);
}
Widget buildBarChart(BuildContext context) {
return BarChart(
return Padding(
padding: const EdgeInsets.only(right: 17),
child: BarChart(
BarChartData(
alignment: BarChartAlignment.spaceAround,
maxY: 20,
......@@ -75,11 +80,11 @@ class StatCharts extends StatelessWidget {
getTitles: (value) {
switch (value.toInt()) {
case 0:
return 'Placeholder1';
return 'Value';
case 1:
return 'Placeholder2';
return 'Value';
case 2:
return 'Placeholder3';
return 'Value';
default:
return '';
}
......@@ -118,6 +123,7 @@ class StatCharts extends StatelessWidget {
),
],
),
),
);
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment