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