Line | |
---|
1 | |
---|
2 | <script> |
---|
3 | $(document).ready(function(){ |
---|
4 | $.jqplot.config.enablePlugins = true; |
---|
5 | $.ajax({ |
---|
6 | // have to use synchronous here, else the function |
---|
7 | // will return before the data is fetched |
---|
8 | //async: false, |
---|
9 | url: "[% c.uri_for('/json/employment', { key => c.req.param('key') }) %]", |
---|
10 | dataType:"json", |
---|
11 | success: function(data) { |
---|
12 | var plot2 = $.jqplot('charth', data.data, |
---|
13 | { |
---|
14 | title: 'Evolution des status', |
---|
15 | stackSeries: true, |
---|
16 | axes: { |
---|
17 | xaxis: { |
---|
18 | renderer: $.jqplot.DateAxisRenderer, |
---|
19 | rendererOptions:{ |
---|
20 | tickRenderer:$.jqplot.CanvasAxisTickRenderer, |
---|
21 | }, |
---|
22 | tickOptions: { |
---|
23 | formatString:'%x', |
---|
24 | fontSize:'10pt', |
---|
25 | fontFamily:'Tahoma', |
---|
26 | angle:-40 |
---|
27 | }, |
---|
28 | tickInterval:'6 months', |
---|
29 | }, |
---|
30 | yaxis: { |
---|
31 | min: 0, |
---|
32 | }, |
---|
33 | }, |
---|
34 | seriesDefaults: { |
---|
35 | fill: true, |
---|
36 | showMarker: false, |
---|
37 | shadow: false, |
---|
38 | lineWidth: 2, |
---|
39 | rendererOptions: { |
---|
40 | padding: 1, |
---|
41 | sliceMargin: 2, |
---|
42 | showDataLabels: true, |
---|
43 | smooth: true |
---|
44 | }, |
---|
45 | //markerOptions:{style:'square'} |
---|
46 | }, |
---|
47 | legend:{ |
---|
48 | placement: 'outside', |
---|
49 | show: true |
---|
50 | }, |
---|
51 | cursor:{ |
---|
52 | zoom:true, |
---|
53 | tooltipLocation:'sw', |
---|
54 | looseZoom: true |
---|
55 | }, |
---|
56 | series: data.series, |
---|
57 | } |
---|
58 | ); |
---|
59 | } |
---|
60 | }); |
---|
61 | }); |
---|
62 | </script> |
---|
63 | |
---|
64 | <div id="charth" style="width:80%; height:600px; clear: both"> |
---|
65 | </div> |
---|
66 | <h3>Expiration à venir</h3> |
---|
67 | [% FOREACH ex = expirelist.keys.sort %] |
---|
68 | [% IF loop.first %] |
---|
69 | <table class=datalist> |
---|
70 | [% END %] |
---|
71 | <tr> |
---|
72 | <th>[% ex | html %]</th> |
---|
73 | <td> |
---|
74 | [% FOREACH exuser = expirelist.$ex.sort %] |
---|
75 | [% IF loop.first %] |
---|
76 | <ul> |
---|
77 | [% END %] |
---|
78 | [% ouser = c.model('Accounts').db.get_object('user', exuser) %] |
---|
79 | <li>[% ouser | html %] ([% ouser.get_attributes('contratType') || 'none' %])</li> |
---|
80 | [% IF loop.last %] |
---|
81 | </ul> |
---|
82 | [% END %] |
---|
83 | [% END %] |
---|
84 | </td> |
---|
85 | </tr> |
---|
86 | [% IF loop.last %] |
---|
87 | </table> |
---|
88 | [% END %] |
---|
89 | [% END %] |
---|
90 | </div> |
---|
91 | |
---|
Note: See
TracBrowser
for help on using the repository browser.