Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
A
arsnova-lite
Manage
Activity
Members
Labels
Plan
Issues
24
Issue boards
Milestones
Wiki
Code
Merge requests
2
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Help
Help
Support
GitLab documentation
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Privacy
Imprint
Contact
Snippets
Groups
Projects
Show more breadcrumbs
ARSnova
arsnova-lite
Commits
5205f77c
Commit
5205f77c
authored
6 years ago
by
Lukas Mauß
Browse files
Options
Downloads
Patches
Plain Diff
Add some i18n to statistic-component
parent
1cce1def
1 merge request
!138
Resolve "Refine answer statistics"
Pipeline
#23734
passed with stages
in 3 minutes and 13 seconds
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/app/components/shared/statistic/statistic.component.ts
+11
-3
11 additions, 3 deletions
src/app/components/shared/statistic/statistic.component.ts
src/app/components/shared/statistics-page/statistics-page.component.ts
+1
-1
1 addition, 1 deletion
...nents/shared/statistics-page/statistics-page.component.ts
with
12 additions
and
4 deletions
src/app/components/shared/statistic/statistic.component.ts
+
11
−
3
View file @
5205f77c
...
...
@@ -3,6 +3,8 @@ import { Chart } from 'chart.js';
import
{
ActivatedRoute
}
from
'
@angular/router
'
;
import
{
ContentService
}
from
'
../../../services/http/content.service
'
;
import
{
ContentChoice
}
from
'
../../../models/content-choice
'
;
import
{
TranslateService
}
from
'
@ngx-translate/core
'
;
import
{
LanguageService
}
from
'
../../../services/util/language.service
'
;
export
class
AnswerList
{
label
:
string
;
...
...
@@ -35,9 +37,14 @@ export class StatisticComponent implements OnInit {
isLoading
=
true
;
constructor
(
protected
route
:
ActivatedRoute
,
private
contentService
:
ContentService
)
{
}
private
contentService
:
ContentService
,
private
translateService
:
TranslateService
,
protected
langService
:
LanguageService
)
{
langService
.
langEmitter
.
subscribe
(
lang
=>
translateService
.
use
(
lang
));
}
ngOnInit
()
{
this
.
translateService
.
use
(
localStorage
.
getItem
(
'
currentLang
'
));
this
.
maxLength
=
innerWidth
/
12
;
this
.
answers
=
new
Array
<
string
>
();
this
.
labels
=
new
Array
<
string
>
();
...
...
@@ -65,11 +72,12 @@ export class StatisticComponent implements OnInit {
this
.
answerList
[
i
].
answer
=
content
.
options
[
i
].
label
;
}
}
this
.
labels
.
push
(
'
Abstentions
'
);
this
.
translateService
.
get
(
'
statistic.abstentions
'
).
subscribe
(
label
=>
{
this
.
labels
.
push
(
label
);
});
this
.
contentService
.
getAnswer
(
content
.
id
).
subscribe
(
answer
=>
{
this
.
data
=
answer
.
roundStatistics
[
0
].
independentCounts
;
this
.
data
.
push
(
answer
.
roundStatistics
[
0
].
abstentionCount
);
console
.
log
(
this
.
data
);
this
.
chart
=
new
Chart
(
'
chart
'
,
{
type
:
'
bar
'
,
data
:
{
...
...
This diff is collapsed.
Click to expand it.
src/app/components/shared/statistics-page/statistics-page.component.ts
+
1
−
1
View file @
5205f77c
...
...
@@ -27,7 +27,7 @@ export class StatisticsPageComponent implements OnInit {
private
roomService
:
RoomService
,
private
translateService
:
TranslateService
,
protected
langService
:
LanguageService
,
public
dialog
:
MatDialog
,
)
{
public
dialog
:
MatDialog
)
{
langService
.
langEmitter
.
subscribe
(
lang
=>
translateService
.
use
(
lang
));
}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
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