pjtzMobileBody.htm 1.9 KB

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