Skip to content

Commit

Permalink
Merge pull request #702 from hpi-studyu/feat/report-overview
Browse files Browse the repository at this point in the history
feat: report overview
  • Loading branch information
ibrahimozkn authored Dec 12, 2024
2 parents 405a692 + 0e82611 commit e43de0a
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ class PerformanceBar extends StatelessWidget {
.map<Color>((index) => rainbow[index])
.toList();

final spacing = (minimum! * 1000).floor();
//final spacing = (minimum! * 1000).floor();

return Column(
crossAxisAlignment: CrossAxisAlignment.start,
Expand Down Expand Up @@ -203,7 +203,9 @@ class PerformanceBar extends StatelessWidget {
),
),
),
if (minimum != null && minimum! >= 0 && minimum! <= 1)

/// Removing the minimum indicator since it is discussed as confusing in the meeting
/*if (minimum != null && minimum! >= 0 && minimum! <= 1)
Column(
children: [
Row(
Expand Down Expand Up @@ -237,7 +239,7 @@ class PerformanceBar extends StatelessWidget {
],
),
],
),
),*/
],
);
}
Expand Down
22 changes: 18 additions & 4 deletions app/lib/screens/study/report/sections/average_section_widget.dart
Original file line number Diff line number Diff line change
Expand Up @@ -77,18 +77,32 @@ class AverageSectionWidget extends ReportSectionWidget {
BarChartData getChartData(BuildContext context, List<DiagramDatum> data) {
final barGroups = getBarGroups(context, data);
final maxY =
((data.sortedBy((entry) => entry.value).toList().lastOrNull?.value ??
0) *
1.1)
(data.sortedBy((entry) => entry.value).toList().lastOrNull?.value ?? 0)
.ceilToDouble();
return BarChartData(
titlesData: FlTitlesData(
bottomTitles: AxisTitles(
axisNameWidget:
(section.aggregate != TemporalAggregation.intervention)
? const Text("Phase")
? Row(
mainAxisAlignment: MainAxisAlignment.center,
crossAxisAlignment: CrossAxisAlignment.end,
children: [
const Text("Phase"),
const SizedBox(width: 8),
Tooltip(
message:
"One phase represents ${subject.study.schedule.phaseDuration} days",
child: const Icon(
Icons.info,
size: 18,
),
),
],
)
: const Text(""),
sideTitles: SideTitles(
reservedSize: 30,
showTitles: true,
getTitlesWidget: getTitles,
),
Expand Down

0 comments on commit e43de0a

Please sign in to comment.