index.htm 2.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283
  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: 'Stacked column chart'
  22. },
  23. xAxis: {
  24. categories: ['Apples', 'Oranges', 'Pears', 'Grapes', 'Bananas']
  25. },
  26. yAxis: {
  27. min: 0,
  28. title: {
  29. text: 'Total fruit consumption'
  30. },
  31. stackLabels: {
  32. enabled: true,
  33. style: {
  34. fontWeight: 'bold',
  35. color: (Highcharts.theme && Highcharts.theme.textColor) || 'gray'
  36. }
  37. }
  38. },
  39. legend: {
  40. align: 'right',
  41. x: -30,
  42. verticalAlign: 'top',
  43. y: 25,
  44. floating: true,
  45. backgroundColor: (Highcharts.theme && Highcharts.theme.background2) || 'white',
  46. borderColor: '#CCC',
  47. borderWidth: 1,
  48. shadow: false
  49. },
  50. tooltip: {
  51. headerFormat: '<b>{point.x}</b><br/>',
  52. pointFormat: '{series.name}: {point.y}<br/>Total: {point.stackTotal}'
  53. },
  54. plotOptions: {
  55. column: {
  56. stacking: 'normal',
  57. dataLabels: {
  58. enabled: true,
  59. color: (Highcharts.theme && Highcharts.theme.dataLabelsColor) || 'white'
  60. }
  61. }
  62. },
  63. series: [{
  64. name: 'John',
  65. data: [5, 3, 4, 7, 2]
  66. }, {
  67. name: 'Jane',
  68. data: [2, 2, 3, 2, 1]
  69. }, {
  70. name: 'Joe',
  71. data: [3, 4, 4, 2, 5]
  72. }]
  73. });
  74. </script>
  75. </body>
  76. </html>