This repository has been archived by the owner on Jul 26, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathpage-home.js
58 lines (58 loc) · 1.59 KB
/
page-home.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
const PageHome = Vue.component('page-home', {
props: ['tip'],
data: function () {
return {
options: {
fullWidth: true,
chartPadding: {
left: 0,
right: 0,
bottom: 0
},
showArea: true,
low: 0,
onlyInteger: true,
axisX: {
showGrid: false,
showLabel: false,
offset: 0
},
axisY: {
showGrid: false,
showLabel: false,
offset: 0
},
plugins: [
Chartist.plugins.ctPointLabels({
textAnchor: 'middle'
})
]
}
};
},
template: '#page-home',
computed: {
localized_goal_num: function() {
return '#' + this.tip.goal_id;
},
localized_text_content: function () {
if (i18n.locale === 'pl') {
return this.tip.text_content;
} else {
return this.tip.text_content_en;
}
},
icon_src: function () {
return 'goals/' + this.tip.goal_id + '.svg';
},
data: function () {
if (this.tip == null) {
return {};
}
return {
labels: this.tip.year_dataset_eu,
series: [this.tip.dataset, this.tip.dataset_eu]
}
}
}
});