You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

55 lines
1.2 KiB

  1. ::use 'admin/design.mtt'::
  2. <h3>::key::</h3>
  3. <p>
  4. Du ::hDate(from):: au ::hDate(to)::<br/>
  5. Total : <b>::total::</b><br/>
  6. Moyenne : <b>::averageValue::</b>
  7. </p>
  8. <p>
  9. <script type="text/javascript" src="/js/rgraph/RGraph.common.core.js" ></script>
  10. <script type="text/javascript" src="/js/rgraph/RGraph.bar.js" ></script>
  11. <canvas id="graph" width="900" height="150">[No canvas support]</canvas>
  12. <script>
  13. window.onload = function ()
  14. {
  15. var datas = [];
  16. var labels = [];
  17. ::foreach d data::
  18. datas.push(::d.value::);
  19. labels.push( '::d.date.toString().substr(0,10)::' );
  20. ::end::
  21. var bar = new RGraph.Bar('graph', datas);
  22. bar.Set('chart.labels', labels);
  23. bar.Set('chart.colors', ['#CC0']);
  24. bar.Set('chart.title', '::key::');
  25. bar.Set('chart.labels.above', true);
  26. bar.Set('chart.background.barcolor1', 'white');
  27. bar.Set('chart.background.barcolor2', 'white');
  28. bar.Set('chart.background.grid', true);
  29. bar.Set('chart.gutter.left', 60);
  30. bar.Set('chart.gutter.bottom', 40);
  31. bar.Set('chart.text.angle', 45);
  32. bar.Draw();
  33. }
  34. </script>
  35. </p>
  36. <p>
  37. <table class="table table-bordered table-striped">
  38. ::foreach d data::
  39. <tr>
  40. <td>::hDate(d.date)::</td>
  41. <td>::d.value::</td>
  42. </tr>
  43. ::end::
  44. </table>
  45. </p>
  46. ::end::