index.htm 1.6 KB

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