5f403fb577f920b18b41a11706e4b0cf7b2ae8f9.svn-base 3.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091
  1. <%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
  2. <%
  3. String path = request.getContextPath();
  4. %>
  5. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  6. <html xmlns="http://www.w3.org/1999/xhtml">
  7. <head>
  8. <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
  9. <!--框架必需start-->
  10. <script type="text/javascript" src="<%=path%>/libs/js/jquery.js"></script>
  11. <script type="text/javascript" src="<%=path%>/libs/js/language/cn.js"></script>
  12. <script type="text/javascript" src="<%=path%>/libs/js/framework.js"></script>
  13. <link href="<%=path%>/libs/css/import_basic.css" rel="stylesheet" type="text/css"/>
  14. <link rel="stylesheet" type="text/css" id="skin" prePath="<%=path%>/"/>
  15. <link rel="stylesheet" type="text/css" id="customSkin"/>
  16. <!--框架必需end-->
  17. <script src="<%=path%>/libs/thirdparty/highcharts/js/highcharts.js"></script>
  18. <script>
  19. $(function () {
  20. $('#container').highcharts({
  21. chart: {
  22. type: 'column'
  23. },
  24. title: {
  25. text: '营养含量'
  26. },
  27. xAxis: {
  28. categories: ['苹果', '橙子', '梨', '葡萄', '香蕉']
  29. },
  30. yAxis: {
  31. min: 0,
  32. title: {
  33. text: '营养含量'
  34. },
  35. stackLabels: {
  36. enabled: true,
  37. style: {
  38. fontWeight: 'bold',
  39. color: (Highcharts.theme && Highcharts.theme.textColor) || 'gray'
  40. }
  41. }
  42. },
  43. legend: {
  44. align: 'right',
  45. x: -70,
  46. verticalAlign: 'top',
  47. y: 20,
  48. floating: true,
  49. backgroundColor: (Highcharts.theme && Highcharts.theme.legendBackgroundColorSolid) || 'white',
  50. borderColor: '#CCC',
  51. borderWidth: 1,
  52. shadow: false
  53. },
  54. tooltip: {
  55. formatter: function() {
  56. return '<b>'+ this.x +'</b><br/>'+
  57. this.series.name +': '+ this.y +'<br/>'+
  58. '总量: '+ this.point.stackTotal;
  59. }
  60. },
  61. plotOptions: {
  62. column: {
  63. stacking: 'normal',
  64. dataLabels: {
  65. enabled: true,
  66. color: (Highcharts.theme && Highcharts.theme.dataLabelsColor) || 'white'
  67. }
  68. }
  69. },
  70. series: [{
  71. name: '维生素A',
  72. data: [5, 3, 4, 7, 2]
  73. }, {
  74. name: '维生素B',
  75. data: [2, 2, 3, 2, 1]
  76. }, {
  77. name: '维生素C',
  78. data: [3, 4, 4, 2, 5]
  79. }]
  80. });
  81. });
  82. </script>
  83. </head>
  84. <body>
  85. <div id="container" style="min-width: 310px; height: 400px; margin: 0 auto"></div>
  86. </body>
  87. </html>