index.htm 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899
  1. <!DOCTYPE HTML>
  2. <html>
  3. <head>
  4. <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
  5. <title>Highcharts Example</title>
  6. <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.8.2/jquery.min.js"></script>
  7. <script type="text/javascript">
  8. $(function () {
  9. $('#container').highcharts({
  10. chart: {
  11. },
  12. title: {
  13. text: 'Combination chart'
  14. },
  15. xAxis: {
  16. categories: ['Apples', 'Oranges', 'Pears', 'Bananas', 'Plums']
  17. },
  18. tooltip: {
  19. formatter: function() {
  20. var s;
  21. if (this.point.name) { // the pie chart
  22. s = ''+
  23. this.point.name +': '+ this.y +' fruits';
  24. } else {
  25. s = ''+
  26. this.x +': '+ this.y;
  27. }
  28. return s;
  29. }
  30. },
  31. labels: {
  32. items: [{
  33. html: 'Total fruit consumption',
  34. style: {
  35. left: '40px',
  36. top: '8px',
  37. color: 'black'
  38. }
  39. }]
  40. },
  41. series: [{
  42. type: 'column',
  43. name: 'Jane',
  44. data: [3, 2, 1, 3, 4]
  45. }, {
  46. type: 'column',
  47. name: 'John',
  48. data: [2, 3, 5, 7, 6]
  49. }, {
  50. type: 'column',
  51. name: 'Joe',
  52. data: [4, 3, 3, 9, 0]
  53. }, {
  54. type: 'spline',
  55. name: 'Average',
  56. data: [3, 2.67, 3, 6.33, 3.33],
  57. marker: {
  58. lineWidth: 2,
  59. lineColor: Highcharts.getOptions().colors[3],
  60. fillColor: 'white'
  61. }
  62. }, {
  63. type: 'pie',
  64. name: 'Total consumption',
  65. data: [{
  66. name: 'Jane',
  67. y: 13,
  68. color: Highcharts.getOptions().colors[0] // Jane's color
  69. }, {
  70. name: 'John',
  71. y: 23,
  72. color: Highcharts.getOptions().colors[1] // John's color
  73. }, {
  74. name: 'Joe',
  75. y: 19,
  76. color: Highcharts.getOptions().colors[2] // Joe's color
  77. }],
  78. center: [100, 80],
  79. size: 100,
  80. showInLegend: false,
  81. dataLabels: {
  82. enabled: false
  83. }
  84. }]
  85. });
  86. });
  87. </script>
  88. </head>
  89. <body>
  90. <script src="../../js/highcharts.js"></script>
  91. <script src="../../js/modules/exporting.js"></script>
  92. <div id="container" style="min-width: 310px; height: 400px; margin: 0 auto"></div>
  93. </body>
  94. </html>