tj1.html 2.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374
  1. {extend name="common/common2" /}
  2. {block name="main"}
  3. <div class="row">
  4. <div class="col-sm-12">
  5. <div class="ibox float-e-margins">
  6. <div class="ibox-content">
  7. <div style="height: 300px" id="tj1"></div>
  8. </div>
  9. <div class="ibox-content" >
  10. <table class="table table-bordered" >
  11. <thead>
  12. <tr>
  13. {foreach $data[0] as $v}
  14. <th>{$v.name}</th>
  15. {/foreach}
  16. </tr>
  17. <tr>
  18. {foreach $data[0] as $v}
  19. <td>{$v.value}</td>
  20. {/foreach}
  21. </tr>
  22. <tr>
  23. {foreach $data[1] as $v}
  24. <th>{$v.name}</th>
  25. {/foreach}
  26. </tr>
  27. <tr>
  28. {foreach $data[1] as $v}
  29. <td>{$v.value}</td>
  30. {/foreach}
  31. </tr>
  32. </thead>
  33. </table>
  34. </div>
  35. </div>
  36. </div>
  37. </div>
  38. {/block}
  39. {block name="script"}
  40. <script type="text/javascript" src="/static/echarts.js"></script>
  41. <script>
  42. $(document).ready(function(){
  43. formSetValue("enable", {$info.enable|default=1});
  44. });
  45. option = {
  46. xAxis: {
  47. type: 'category',
  48. data: {:json_encode($key)}
  49. },
  50. yAxis: {
  51. type: 'value'
  52. },
  53. series: [{
  54. data: {:json_encode($value)},
  55. type: 'line'
  56. }],
  57. tooltip : {
  58. trigger: 'axis',
  59. axisPointer: {
  60. type: 'cross',
  61. label: {
  62. backgroundColor: '#6a7985'
  63. }
  64. }
  65. }
  66. };
  67. var myChart = echarts.init(document.getElementById('tj1'));
  68. myChart.setOption(option);
  69. </script>
  70. {/block}