blob: 85374c5b9870871cfbf3fcc5d414fc187703ca96 (
plain)
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
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
|
{% load i18n %}
<style>
</style>
<div>
<div id="stats-form-{{name}}">
<label for="stats_renderer-{{name}}">{% trans "Type" %}</label>
<select id="stats_renderer-{{name}}" name="stats_renderer">
<option value="line" selected='selected'>{% trans "Line" %}</option>
<option value="bar">{% trans "Bar" %}</option>
<option value="pie">{% trans "Pie" %}</option>
<option value="table">{% trans "Table" %}</option>
</select>
<label for="stats_modality_1-{{name}}">{% trans "Modality 1" %}</label>
<select id="stats_modality_1-{{name}}" name="stats_modality_1">
{% for modality, modality_lbl in current_model.STATISTIC_MODALITIES_OPTIONS.items %}
<option value="{{modality}}"{% if forloop.first %} selected='selected'{% endif %}>{{modality_lbl}}</option>
{% endfor %}
</select>
<label for="stats_modality_2-{{name}}">{% trans "Modality 2" %}</label>
<select id="stats_modality_2-{{name}}" name="stats_modality_2">
<option value="" selected='selected'>--</option>
{% for modality, modality_lbl in current_model.STATISTIC_MODALITIES_OPTIONS.items %}
<option value="{{modality}}">{{modality_lbl}}</option>
{% endfor %}
</select>
<label for="stats_sum-{{name}}">{% trans "Sum" %}</label>
<select id="stats_sum-{{name}}" name="stats_sum">
{% for sum_var, sum_var_lbl in current_model.STATISTIC_SUM_VARIABLE.items %}
<option value="{{sum_var}}"{% if forloop.first %} selected='selected'{% endif %}>{{sum_var_lbl}}</option>
{% endfor %}
</select>
</div>
<hr/>
<div id="charts-{{name}}">
<div id="chart-{{name}}-wrapper" class="chart-wrapper">
<div id="chart-{{name}}" class="chart-content"></div>
<div class="resize-handler"></div>
</div>
<hr/>
<p class='alert alert-info' id="stats-zoom-help-{{name}}" style="z-index:-1">
<i class="fa fa-info-circle" aria-hidden="true"></i>
{% trans 'Draw rectangle on the graph to zoom. Double-click to reinitialize.' %}
</p>
<div class='form chart-img-form'>
<div class="text-center">
<button id="chart-img-display-{{name}}"
type='button' class='btn btn-secondary'>
{% trans "Display as an image" %}
</button>
</div>
<br>
<div id="chart-img-{{name}}" class='chart-img'>
<div class="card">
<div id="img-{{name}}"
class="card-img-top text-center ml-3 mt-3"></div>
<div class="card-body">
<div class='alert alert-info'>
<i class="fa fa-info-circle" aria-hidden="true"></i>
{% trans 'Right-click on this image to save it.' %}
</div>
</div>
</div>
</div>
</div>
</div>
<div id="stats-table-{{name}}">
<div id="stats-table-content-{{name}}"></div>
<hr>
<div class="text-center">
<a id="stats-table-csv-{{name}}" href="#"
type='button' class='btn btn-secondary'>
{% trans "Export as CSV" %}
</a>
</div>
</div>
</div>
<script language="javascript" type="text/javascript">
jQuery(document).ready(function(){
$("#chart-{{name}}-wrapper").resizable({
handleSelector: ".resize-handler",
onDrag: function (e, $el, opt) {
stats_current_graph.replot( { resetAxes: true } );
}
});
}
);
</script>
|