tj2.html 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  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 as $v}
  14. <th>{$v.name}</th>
  15. {/foreach}
  16. </tr>
  17. <tr>
  18. {foreach $data as $v}
  19. <td>{$v.value}</td>
  20. {/foreach}
  21. </tr>
  22. </thead>
  23. </table>
  24. </div>
  25. </div>
  26. </div>
  27. </div>
  28. {/block}
  29. {block name="script"}
  30. <script type="text/javascript" src="/static/echarts.js"></script>
  31. <script>
  32. $(document).ready(function(){
  33. formSetValue("enable", {$info.enable|default=1});
  34. });
  35. option = {
  36. xAxis: {
  37. type: 'category',
  38. data: {:json_encode($key)}
  39. },
  40. yAxis: {
  41. type: 'value'
  42. },
  43. series: [{
  44. data: {:json_encode($value)},
  45. type: 'line'
  46. }],
  47. tooltip : {
  48. trigger: 'axis',
  49. axisPointer: {
  50. type: 'cross',
  51. label: {
  52. backgroundColor: '#6a7985'
  53. }
  54. }
  55. }
  56. };
  57. var myChart = echarts.init(document.getElementById('tj1'));
  58. myChart.setOption(option);
  59. </script>
  60. {/block}