市长热线演示版

DJZZT.htm 4.1KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116
  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. <title>叠加柱状图</title>
  5. <script type="text/javascript" src="../ThirdParty/js/jquery-1.8.3.min.js"></script>
  6. <script type="text/javascript" src="../ThirdParty/js/highcharts.js"></script>
  7. <script type="text/javascript" src="../ThirdParty/js/modules/exporting.js"></script>
  8. <script>
  9. $(function() {
  10. $('#container').highcharts({
  11. chart: {
  12. type: 'column'
  13. },
  14. title: {
  15. text: '洛阳市12369服务热线-接通率和呼损率统计'
  16. },
  17. xAxis: {
  18. categories: ['苹果', '橙子', '梨', '葡萄', '香蕉']
  19. },
  20. yAxis: {
  21. min: 0,
  22. title: {
  23. text: '营养含量'
  24. },
  25. stackLabels: {
  26. enabled: true,
  27. style: {
  28. fontWeight: 'bold',
  29. color: (Highcharts.theme && Highcharts.theme.textColor) || 'gray'
  30. }
  31. }
  32. },
  33. legend: {
  34. align: 'right',
  35. x: -70,
  36. verticalAlign: 'top',
  37. y: 20,
  38. floating: true,
  39. backgroundColor: (Highcharts.theme && Highcharts.theme.legendBackgroundColorSolid) || 'white',
  40. borderColor: '#CCC',
  41. borderWidth: 1,
  42. shadow: false
  43. },
  44. tooltip: {
  45. formatter: function() {
  46. if (this.point.stackTotal != undefined)
  47. return '<b>' + this.x + '</b><br/>' +
  48. this.series.name + ': ' + this.y + '<br/>' +
  49. '总量: ' + this.point.stackTotal;
  50. else
  51. return '<b>' + this.x + '</b><br/>' +
  52. this.series.name + ': ' + this.y + '%<br/>';
  53. }
  54. },
  55. plotOptions: {
  56. column: {
  57. stacking: 'normal',
  58. dataLabels: {
  59. enabled: true,
  60. color: (Highcharts.theme && Highcharts.theme.dataLabelsColor) || 'white'
  61. }
  62. }
  63. },
  64. tooltip: {
  65. shared: true
  66. },
  67. series: [{
  68. name: '维生素A',
  69. data: [5, 3, 4, 7, 2]
  70. }, {
  71. name: '维生素B',
  72. data: [2, 2, 3, 2, 1]
  73. }, {
  74. name: '维生素C',
  75. data: [3, 4, 4, 2, 5]
  76. }, {
  77. type: 'spline',
  78. name: '呼损率',
  79. tooltip: {
  80. valueSuffix: '%'
  81. },
  82. data: [3, 2.67, 3, 6.33, 3.33],
  83. marker: {
  84. lineWidth: 2,
  85. lineColor: Highcharts.getOptions().colors[5],
  86. fillColor: 'white'
  87. }
  88. }, {
  89. type: 'spline',
  90. name: '接通率',
  91. tooltip: {
  92. valueSuffix: '%'
  93. },
  94. data: [7, 7.33, 7, 3.67, 6.67],
  95. marker: {
  96. lineWidth: 2,
  97. lineColor: Highcharts.getOptions().colors[5],
  98. fillColor: 'white'
  99. }
  100. }]
  101. });
  102. });
  103. </script>
  104. </head>
  105. <body>
  106. <div id="container" style="min-width: 700px; height: 400px">
  107. </div>
  108. </body>
  109. </html>