Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
P
PROG2900
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Sara Savanovic Djordjevic
PROG2900
Commits
f5237bc0
Commit
f5237bc0
authored
1 year ago
by
Sara Savanovic Djordjevic
Browse files
Options
Downloads
Patches
Plain Diff
add: 4th layer on bar chart
parent
34cffbf1
No related branches found
Branches containing commit
No related tags found
1 merge request
!12
Clhp map
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
app/lib/widgets/bar_graph/bar_data.dart
+18
-9
18 additions, 9 deletions
app/lib/widgets/bar_graph/bar_data.dart
app/lib/widgets/main_layout.dart
+3
-3
3 additions, 3 deletions
app/lib/widgets/main_layout.dart
with
21 additions
and
12 deletions
app/lib/widgets/bar_graph/bar_data.dart
+
18
−
9
View file @
f5237bc0
...
...
@@ -16,14 +16,15 @@ class _BarDataState extends State<BarData> {
// NB should be allocated values dynamically
// Bar items show data for 10 previous days
static
const
barData
=
<
int
,
List
<
double
>>{
0
:
[
1.5
,
4
,
2.
5
],
1
:
[
1.8
,
5
.6
,
3
],
2
:
[
1.5
,
3
.1
,
3
.5
],
3
:
[
1.5
,
1
.5
,
4
],
4
:
[
2
,
2
,
5
],
5
:
[
1.2
,
1.
5
,
4
.3
],
6
:
[
1.2
,
4.8
,
5
],
0
:
[
1.5
,
3.2
,
1.5
,
2.
2
],
1
:
[
1.8
,
4
.6
,
2
,
3.1
],
2
:
[
1.5
,
2
.1
,
2
.5
,
1.8
],
3
:
[
1.5
,
1
,
3
,
2.6
],
4
:
[
2
,
2
,
3.9
,
2.3
],
5
:
[
1.2
,
1.
2
,
3
.3
,
2.9
],
6
:
[
1.2
,
2.3
,
3.3
,
3.2
],
};
int
touchedIndex
=
-
1
;
@override
...
...
@@ -36,8 +37,9 @@ class _BarDataState extends State<BarData> {
double
value1
,
double
value2
,
double
value3
,
double
value4
,
)
{
final
sum
=
value1
+
value2
+
value3
;
final
sum
=
value1
+
value2
+
value3
+
value4
;
final
isTouched
=
touchedIndex
==
x
;
return
BarChartGroupData
(
x:
x
,
...
...
@@ -64,6 +66,11 @@ class _BarDataState extends State<BarData> {
BarChartRodStackItem
(
value1
+
value2
,
value1
+
value2
+
value3
,
const
Color
(
0xFF3766E0
),
),
BarChartRodStackItem
(
value1
+
value2
+
value3
,
value1
+
value2
+
value3
+
value4
,
Colors
.
white60
,
),
],
...
...
@@ -144,6 +151,7 @@ class _BarDataState extends State<BarData> {
e
.
value
[
0
],
e
.
value
[
1
],
e
.
value
[
2
],
e
.
value
[
3
],
),
)
.
toList
(),
),
...
...
@@ -156,8 +164,9 @@ class _BarDataState extends State<BarData> {
mainAxisAlignment:
MainAxisAlignment
.
spaceEvenly
,
children:
[
_buildLegendItem
(
Colors
.
white60
,
"Snow"
),
_buildLegendItem
(
const
Color
(
0xFF3766E0
),
"Slush ice"
),
_buildLegendItem
(
const
Color
(
0xFF000085
),
"Black ice"
),
_buildLegendItem
(
const
Color
(
0xFF13dbff
),
"S
lush
ice"
),
_buildLegendItem
(
const
Color
(
0xFF13dbff
),
"S
teel
ice"
),
],
),
),
...
...
This diff is collapsed.
Click to expand it.
app/lib/widgets/main_layout.dart
+
3
−
3
View file @
f5237bc0
...
...
@@ -60,7 +60,7 @@ class _MapContainerWidgetState extends State<MapContainerWidget> {
void
handleSelection
(
int
index
)
{
String
indexString
=
index
.
toString
();
setState
(()
{
// NB should be optim
al
ised
// NB should be optimised
for
(
Measurement
measurement
in
widget
.
markerList
)
{
for
(
SubDiv
subdivision
in
measurement
.
subDivs
)
{
if
(
subdivision
.
sub_div_id
==
indexString
)
{
...
...
@@ -283,8 +283,8 @@ class _MapContainerWidgetState extends State<MapContainerWidget> {
const SizedBox(width: 10),
Expanded(
child: Text(
'
For
every
x
of
y
,
there
has
to
be
z
cm
of
'
'
q
for
every
kg
of
applied
weight
to
ensure
?
',
'
There
may
be
multiple
layers
of
black
ice
and
slush
ice
stacked
'
'
between
the
snow
and
the
steel
ice
.
',
style: regTextStyle,
),
),
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment