tj1.html 942 B

123456789101112131415161718192021222324252627282930313233343536373839404142
  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>
  10. </div>
  11. </div>
  12. {/block}
  13. {block name="script"}
  14. <script type="text/javascript" src="/static/echarts.js"></script>
  15. <script>
  16. option = {
  17. xAxis: {
  18. type: 'category',
  19. data: {:json_encode($key)}
  20. },
  21. yAxis: {
  22. type: 'value'
  23. },
  24. series: [{
  25. data: {:json_encode($value)},
  26. type: 'line'
  27. }],
  28. tooltip : {
  29. trigger: 'axis',
  30. axisPointer: {
  31. type: 'cross',
  32. label: {
  33. backgroundColor: '#6a7985'
  34. }
  35. }
  36. }
  37. };
  38. var myChart = echarts.init(document.getElementById('tj1'));
  39. myChart.setOption(option);
  40. </script>
  41. {/block}