29b3d6eb6f5e21ce14277296986c1246e3fafef0.svn-base 3.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119
  1. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  2. <html xmlns="http://www.w3.org/1999/xhtml">
  3. <head>
  4. <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
  5. <!--框架必需start-->
  6. <script type="text/javascript" src="/nwyj/scripts/qui/libs/js/jquery.js"></script>
  7. <script type="text/javascript" src="/nwyj/scripts/qui/libs/js/language/cn.js"></script>
  8. <script type="text/javascript" src="/nwyj/scripts/qui/libs/js/framework.js"></script>
  9. <link href="/qui/libs/css/import_basic.css" rel="stylesheet" type="text/css"/>
  10. <link rel="stylesheet" type="text/css" id="skin" prePath="/qui/"/>
  11. <link rel="stylesheet" type="text/css" id="customSkin"/>
  12. <!--框架必需end-->
  13. <script src="/nwyj/scripts/qui/libs/thirdparty/highcharts/js/highcharts.js"></script>
  14. <script>
  15. var categories;
  16. var title;
  17. var series;
  18. function initgird() {
  19. alert(series);
  20. alert(categories);
  21. $('#container').highcharts({
  22. chart: {
  23. type: 'column'
  24. },
  25. title: {
  26. text: '营养含量'
  27. },
  28. xAxis: {
  29. categories: eval('('+categories+')')
  30. },
  31. yAxis: {
  32. min: 0,
  33. title: {
  34. text: '营养含量'
  35. },
  36. stackLabels: {
  37. enabled: true,
  38. style: {
  39. fontWeight: 'bold',
  40. color: (Highcharts.theme && Highcharts.theme.textColor) || 'gray'
  41. }
  42. }
  43. },
  44. legend: {
  45. align: 'right',
  46. x: -70,
  47. verticalAlign: 'top',
  48. y: 20,
  49. floating: true,
  50. backgroundColor: (Highcharts.theme && Highcharts.theme.legendBackgroundColorSolid) || 'white',
  51. borderColor: '#CCC',
  52. borderWidth: 1,
  53. shadow: false
  54. },
  55. tooltip: {
  56. formatter: function() {
  57. return '<b>'+ this.x +'</b><br/>'+
  58. this.series.name +': '+ this.y +'<br/>'+
  59. '总量: '+ this.point.stackTotal;
  60. }
  61. },
  62. plotOptions: {
  63. column: {
  64. stacking: 'normal',
  65. dataLabels: {
  66. enabled: true,
  67. color: (Highcharts.theme && Highcharts.theme.dataLabelsColor) || 'white'
  68. }
  69. }
  70. },
  71. series: eval('('+series+')')
  72. });
  73. };
  74. $(function () {
  75. var urls = "/nwyj/ws/PlanHuiZong/ContingencyPlanHuiZong/getAllSum";
  76. //var urls = "/nwyj/ws/rcbaobiao/RcBbService/getHighChart";
  77. $.ajax({
  78. url : urls,
  79. type : 'post',
  80. params:{deptID:'11'},
  81. timeout : 15000,
  82. async : false,
  83. dataType : 'json',
  84. success : function(data) {
  85. //alert(JSON.stringify(data));
  86. // alert(typeof data);
  87. var sss=data.beanList;
  88. alert(typeof sss);
  89. var ssss=JSON.stringify(sss);
  90. var s1=ssss.replace("\"{normal: {label:{show: true, position: insideRight}}}\"", "{normal: {label:{show: true, position: \"insideRight\"}}}");
  91. alert(s1);
  92. var s2=eval('('+ s1+')');
  93. alert(JSON.stringify(s2));
  94. series = data.series;
  95. categories=data.categories;
  96. initgird();
  97. },
  98. error : function(e) {
  99. $.messager.alert('查询失败!', '访问服务失败!', 'error');
  100. }
  101. });
  102. });
  103. </script>
  104. </head>
  105. <body>
  106. <div id="container" style="min-width: 310px; height: 400px; margin: 0 auto"></div>
  107. </body>
  108. </html>