p_user_shopfx.html 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125
  1. {Template phone/header_phone}
  2. <div class="qxtss" style="text-align: center;"><a href="/user/statistics" style="color:#666">进入数据统计</a></div>
  3. <div id="yzcontainer" style="height:30%"></div>
  4. <ul class="qsttime dr">
  5. <li data-time="7" class="ac" style="width:40%;margin: 15px 5% 0px 5%;">周</li>
  6. <li data-time="30" style="width:40%;margin: 15px 5% 0px 5%;">月</li>
  7. <div style="clear: both;"></div>
  8. </ul>
  9. <div id="container" style="height:200%;"></div>
  10. <input style="display:none" value="7" name="time" type="text">
  11. <script src="{$theme}js/echarts.min.js"></script>
  12. <script type="text/javascript">
  13. $(document).ready(function() {
  14. defaultgo();
  15. })
  16. $(".qsttime li").click(function() {
  17. var time = $(this).data("time");
  18. $("input[name=time]").val(time)
  19. $(".qsttime li").removeClass("ac");
  20. $(this).addClass("ac");
  21. defaultgo(time);
  22. });
  23. function defaultgo() {
  24. layx.load('loadId','数据加载中');
  25. var time = $("input[name=time]").val();
  26. if(time < 10)
  27. {
  28. $("#container").css('height', '100%');
  29. }
  30. else
  31. {
  32. $("#container").css('height', '400%');
  33. }
  34. $.ajax({
  35. url: "/user/shopfx/",
  36. data: "time="+time,
  37. type: "POST",
  38. dataType: "json",
  39. success: function(a) {
  40. layx.destroy('loadId');
  41. if (a && a.success) {
  42. echartsread(a);
  43. }
  44. }
  45. });
  46. }
  47. function echartsread(datalist) {
  48. var dom = document.getElementById('yzcontainer');
  49. var myChart = echarts.init(dom);
  50. var app = {};
  51. option = null;
  52. option = {
  53. toolbox: {
  54. show: true,
  55. feature: {
  56. mark: { show: false },
  57. dataView: { show: false, readOnly: false },
  58. restore: { show: false },
  59. saveAsImage: { show: false }
  60. }
  61. },
  62. series: [
  63. {
  64. name: 'Nightingale Chart',
  65. type: 'pie',
  66. radius: [5, '45%'],
  67. center: ['50%', '50%'],
  68. roseType: 'area',
  69. itemStyle: {
  70. borderRadius: 8
  71. },
  72. data: datalist.data
  73. }
  74. ]
  75. };
  76. if (option && typeof option === "object") {
  77. myChart.setOption(option, true);
  78. }
  79. var dom = document.getElementById('container');
  80. var myChart = echarts.init(dom, null, {
  81. renderer: 'canvas',
  82. useDirtyRect: false
  83. });
  84. var app = {};
  85. var option;
  86. option = {
  87. tooltip: {
  88. trigger: 'axis',
  89. axisPointer: {
  90. type: 'shadow'
  91. }
  92. },
  93. legend: {},
  94. grid: {
  95. left: '3%',
  96. right: '4%',
  97. bottom: '3%',
  98. containLabel: true
  99. },
  100. xAxis: {
  101. type: 'value',
  102. boundaryGap: [0, 0.01]
  103. },
  104. yAxis: {
  105. type: 'category',
  106. data: datalist.t
  107. },
  108. series: datalist.list
  109. };
  110. if (option && typeof option === "object") {
  111. myChart.setOption(option, true);
  112. }
  113. myChart.resize();
  114. }
  115. </script>
  116. {Template phone/footer_phone}