You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

77 lines
1.8 KiB

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