-
Notifications
You must be signed in to change notification settings - Fork 0
/
activ_month.html.erb
71 lines (71 loc) · 2.37 KB
/
activ_month.html.erb
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
59
60
61
62
63
64
65
66
67
68
69
70
71
<div id="chart-activ-month" style="width: 100%; height: 400px;">
</div>
<script type="text/javascript" charset="urf-8">
$(function() {
new Highcharts.Chart({
chart: { renderTo: 'chart-activ-month', zoomType: 'x', backgroundColor: "#F4F4FF"},
title: { text: 'Месяц'},
xAxis: { type: 'datetime'},
yAxis: {
title: { text: 'Активность'},
min: 0,
labels: {
formatter: function() {
return this.value
}
}
},
tooltip: {
formatter: function () {
return Highcharts.dateFormat("%B %e %Y", this.x) + ': ' + Highcharts.numberFormat(this.y, 2);
}
},
plotOptions: {
line: {
dataLabels: {
enabled: true
},
}
},
series: [{
name: "<%= Report.return_name %>",
pointInterval: <%= 1.day * 1000 %>,
pointStart: <%= 1.months.ago.to_i * 1000 %>,
data: <%= (1.months.ago.to_date..Date.today).map { |date| Report.activ_user(date)}.inspect %>
}],
exporting: {
buttons: {
exportButton: {
exportButtonTitle: "fewjfhwuefhuiew",
menuItems: [{
text: "Сохранить в PNG",
onclick: function(){ this.exportChart();}
},
{
text: "Сохранить в JPG",
onclick: function(){ this.exportChart();}
},
{
text: "Сохранить в PDF",
onclick: function() {this.exportChart();}
},
null
]
}
},
enabled: true,
filename: 'График за год',
type: 'image/png'
},
});
Highcharts.setOptions({
lang: {
months: ['Январь','Февраль', 'Март', 'Апрель', 'Май', 'Июнь', 'Июль', 'Август', 'Сентябрь', 'Октябрь', 'Ноябрь', 'Декабрь'],
shortMonths: ['Янв','Фев','Мар','Апр','Май','Июн','Июл','Авг','Сен','Окт','Ноя','Дек'],
resetZoom: 'Сброс',
resetZoomTitle: "Вернуться к масштабу 1:1",
weekdays: ['Понедельник', 'Вторник', 'Среда', 'Четверг', 'Пятница', 'Суббота', 'Воскресенье']
},
});
});
</script>