qcxhMobileBody.htm 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495
  1. <!doctype html>
  2. <html>
  3. <head>
  4. <script>
  5. $(function() {
  6. $('#container').highcharts({
  7. chart: {
  8. backgroundColor: "rgba(0,0,0,0)", // 背景透明
  9. margin: [30, 10, 50, 45],
  10. renderTo: "container"
  11. },
  12. colors: ["#3a8ecf", "#f6bd0f","#8bba00"],
  13. exporting: {
  14. enabled: false
  15. },
  16. title: {
  17. text: "全程消耗",
  18. style: {
  19. fontSize: 16,
  20. },
  21. margin: 10
  22. },
  23. xAxis: {
  24. categories: eval($("#categories").val()),
  25. },
  26. yAxis: {
  27. title: {
  28. text: null
  29. },
  30. tickPixelInterval: 50,
  31. gridLineDashStyle: 'longdash'
  32. },
  33. tooltip: {
  34. valueDecimals: 1,
  35. valueSuffix: "Kg",
  36. followTouchMove: true,
  37. followPointer:true,
  38. shared: true,
  39. useHTML: true,
  40. crosshairs: [{
  41. width: 2,
  42. color: "gray",
  43. dashStyle: "shortdot"
  44. }, {
  45. width: 2,
  46. color: "gray",
  47. dashStyle: "shortdot"
  48. } ]
  49. },
  50. legend: {
  51. layout: 'vertical',
  52. align: 'right',
  53. verticalAlign: "top",
  54. borderWidth: 0
  55. },
  56. credits: {
  57. enabled: false
  58. },
  59. plotOptions: {
  60. column: {
  61. pointPadding: 0.2,
  62. borderWidth: 0
  63. },
  64. series: {
  65. marker: {
  66. enabled: true, //数据点是否显示
  67. radius: 3, //数据点大小
  68. },
  69. }
  70. },
  71. series: [ {
  72. name: "采食区一",
  73. data: eval($("#csq1data").val())
  74. }, {
  75. name: "采食区二",
  76. data: eval($("#csq2data").val())
  77. }, {
  78. name: "整  体",
  79. data: eval($("#ztdata").val())
  80. } ],
  81. });
  82. });
  83. </script>
  84. </head>
  85. <body>
  86. <input type="hidden" id="categories" name="categories" value="$!categories" />
  87. <input type="hidden" id="csq1data" name="csq1data" value="$!csq1data" />
  88. <input type="hidden" id="csq2data" name="csq2data" value="$!csq2data" />
  89. <input type="hidden" id="ztdata" name="ztdata" value="$!ztdata" />
  90. <input type="hidden" value="$!type" id="type">
  91. <div>
  92. <div id="container" style="height: 100%; width: 100%;"></div>
  93. </div>
  94. </body>
  95. </html>