Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
s7_spruge_k
calendar
Commits
7a153a78
Commit
7a153a78
authored
Jun 18, 2019
by
s7_spruge_k
Browse files
graphs done
parent
b5d311f0
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
28 additions
and
1 deletion
+28
-1
src/main/java/com/example/calendar/controller/GraphController.java
...java/com/example/calendar/controller/GraphController.java
+28
-1
No files found.
src/main/java/com/example/calendar/controller/GraphController.java
View file @
7a153a78
...
...
@@ -247,11 +247,38 @@ public class GraphController {
}
else
if
(
statHelper
.
getStatMethod
().
equals
(
"Analysis by day"
))
{
ArrayList
<
Integer
>
eventCountThisMonth
=
new
ArrayList
<>();
LocalDate
now
=
LocalDate
.
now
();
for
(
int
i
=
1
;
i
<=
now
.
lengthOfMonth
();
i
++)
{
int
temp
=
0
;
for
(
Event
e
:
allEventsInCal
)
{
if
(
e
.
getStartDate
().
getDayOfMonth
()
==
i
&&
now
.
getYear
()
==
e
.
getStartDate
().
getYear
())
{
temp
++;
}
}
eventCountThisMonth
.
add
(
temp
);
}
JsonArray
eventArray
=
new
JsonArray
();
for
(
int
i
=
0
;
i
<
eventCountThisMonth
.
size
();
i
++)
{
JsonObject
eventJson
=
new
JsonObject
();
eventJson
.
addProperty
(
"name"
,
i
+
1
);
eventJson
.
addProperty
(
"eventCount"
,
eventCountThisMonth
.
get
(
i
));
eventArray
.
add
(
eventJson
);
}
String
title
=
"Event count this month by days: "
+
statHelper
.
getChosenCalendar
();
models
.
addAttribute
(
"name"
,
title
);
models
.
addAttribute
(
"allEvents"
,
eventArray
);
}
models
.
addAttribute
(
"graphType"
,
statHelper
.
getGraphMethod
());
//models.addAttribute("statHelper", statHelper);
return
"statsTest"
;
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment