This commit is contained in:
Hillel Coren 2020-02-16 15:02:19 +02:00
parent 31b355fc8f
commit 6ac4141590
1 changed files with 32 additions and 21 deletions

View File

@ -382,12 +382,13 @@ class ReportCharts extends StatelessWidget {
),
labelStyle: charts.TextStyleSpec(fontSize: 10, color: color)));
return FormCard(
child: SizedBox(
height: 200,
child: charts.BarChart(
Widget child;
switch (getReportColumnType(reportsUIState.group)) {
case ReportColumnType.string:
case ReportColumnType.bool:
child = charts.BarChart(
[
new charts.Series<dynamic, String>(
charts.Series<dynamic, String>(
id: 'chart',
colorFn: (dynamic _, __) =>
charts.MaterialPalette.blue.shadeDefault,
@ -399,13 +400,23 @@ class ReportCharts extends StatelessWidget {
'value': viewModel.reportTotals[key]
[reportsUIState.chart]
})
.toList(),
)
.toList())
],
animate: true,
primaryMeasureAxis: numericAxis,
domainAxis: axis,
),
);
break;
case ReportColumnType.dateTime:
case ReportColumnType.number:
}
return child == null
? SizedBox()
: FormCard(
child: SizedBox(
height: 200,
child: child,
),
);
}