index.htm 2.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576
  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. type: 'column'
  12. },
  13. title: {
  14. text: 'Total fruit consumtion, grouped by gender'
  15. },
  16. xAxis: {
  17. categories: ['Apples', 'Oranges', 'Pears', 'Grapes', 'Bananas']
  18. },
  19. yAxis: {
  20. allowDecimals: false,
  21. min: 0,
  22. title: {
  23. text: 'Number of fruits'
  24. }
  25. },
  26. tooltip: {
  27. formatter: function() {
  28. return '<b>'+ this.x +'</b><br/>'+
  29. this.series.name +': '+ this.y +'<br/>'+
  30. 'Total: '+ this.point.stackTotal;
  31. }
  32. },
  33. plotOptions: {
  34. column: {
  35. stacking: 'normal'
  36. }
  37. },
  38. series: [{
  39. name: 'John',
  40. data: [5, 3, 4, 7, 2],
  41. stack: 'male'
  42. }, {
  43. name: 'Joe',
  44. data: [3, 4, 4, 2, 5],
  45. stack: 'male'
  46. }, {
  47. name: 'Jane',
  48. data: [2, 5, 6, 2, 1],
  49. stack: 'female'
  50. }, {
  51. name: 'Janet',
  52. data: [3, 0, 4, 4, 3],
  53. stack: 'female'
  54. }]
  55. });
  56. });
  57. </script>
  58. </head>
  59. <body>
  60. <script src="../../js/highcharts.js"></script>
  61. <script src="../../js/modules/exporting.js"></script>
  62. <div id="container" style="min-width: 310px; height: 400px; margin: 0 auto"></div>
  63. </body>
  64. </html>