Bug 17282: Ability to create charts for SQL reports
[koha.git] / koha-tmpl / intranet-tmpl / prog / en / includes / chart.inc
1 <div id="makechart" style="display:none;">
2     [% supposed_x = header_row.shift.cell %]
3
4     <fieldset>
5         <legend>Draw a chart</legend>
6         <ol>
7             <li>
8                 <label for="chart-type">Chart type</label>
9                 <select name="chart-type" id="chart-type">
10                     <option value="pie">Pie</option>
11                     <option value="bar">Bar</option>
12                     <option value="line">Line</option>
13                 </select>
14
15                 <div id="chart-column-horizontal">
16                     <label for="horizontal">Horizontal bar:</label>
17                     <input id="horizontal" name="column-horizontal" type="checkbox">
18                 </div>
19             </li>
20
21             <li>
22                 <label for="x_element">x column:</label>
23                 <select id="x_element" name="x">
24                     <option value="[% supposed_x %]" selected>[% supposed_x %]</option>
25                     [% FOREACH header IN header_row %]
26                         <option value="[% header.cell %]">[% header.cell %]</option>
27                     [% END %]
28                 </select>
29             </li>
30
31             <div>
32                 <label for="include-all">Include all rows (ignore pagination)</label>
33                 <input id="include-all" name="chart-include-all" type="checkbox">
34             </div>
35
36
37             <label for="exclude-last">Exclude last line (Rollup)</label>
38             <input id="exclude-last" name="chart-exclude-last" type="checkbox">
39
40             [% column = 1 %]
41             <li>
42                 [% FOREACH header IN header_row %]
43                     <fieldset class="chart-column-conf" id="column_[% column %]" style="display: inline !important;">
44                         <legend>
45                             Column [% column %]
46                             <a class="chart-column-delete" href="#" data-column="[% column %]">
47                                 <img src="[% interface %]/[% theme %]/img/x.png" alt="Delete" />
48                             </a>
49                         </legend>
50                         <div>
51                             <label for="y_[% column %]" >y:</label>
52                             <select id="y_[% column %]" name="y">
53                                 <option value="[% supposed_x %]" selected>[% supposed_x %]</option>
54                                 [% FOREACH h IN header_row %]
55                                     [% IF header.cell == h.cell %]
56                                         <option value="[% h.cell %]" selected>[% h.cell %]</option>
57                                     [% ELSE %]
58                                         <option value="[% h.cell %]">[% h.cell %]</option>
59                                     [% END %]
60                             [% END %]
61                             </select>
62                         </div>
63
64                         <div class="chart-column-group">
65                             [% i = 1 %]
66                             <label for="group_[% column %]">Group:</label>
67                             <select id="group_[% column %]" name="group">
68                                 [% FOREACH h IN header_row %]
69                                     [% IF i == column %]
70                                         <option value="[% i %]" selected>[% i %]</option>
71                                     [% ELSE %]
72                                         <option value="[% i %]">[% i %]</option>
73                                     [% END %]
74                                     [% i = i + 1 %]
75                                 [% END %]
76                             </select>
77                         </div>
78
79                         <div class="chart-column-line">
80                             <label for="line_[% column %]">line:</label>
81                             <input class="column-line" id="column-line" name="[% header.cell %]" type="checkbox">
82                         </div>
83                     </fieldset>
84                     [% column = column + 1 %]
85                 [% END %]
86             </li>
87
88             <li>
89                 <button id="draw-chart" class="btn btn-default">Draw</button>
90             </li>
91         </ol>
92     </fieldset>
93     [% item = { cell = supposed_x } %]
94     [% header_row.unshift(item) %]
95     <div id="chart"></div>
96 </div>