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.

83 lines
2.0 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: 'area',
  15. inverted: true
  16. },
  17. title: {
  18. text: 'Average fruit consumption during one week'
  19. },
  20. subtitle: {
  21. style: {
  22. position: 'absolute',
  23. right: '0px',
  24. bottom: '10px'
  25. }
  26. },
  27. legend: {
  28. layout: 'vertical',
  29. align: 'right',
  30. verticalAlign: 'top',
  31. x: -150,
  32. y: 100,
  33. floating: true,
  34. borderWidth: 1,
  35. backgroundColor: (Highcharts.theme && Highcharts.theme.legendBackgroundColor) || '#FFFFFF'
  36. },
  37. xAxis: {
  38. categories: [
  39. 'Monday',
  40. 'Tuesday',
  41. 'Wednesday',
  42. 'Thursday',
  43. 'Friday',
  44. 'Saturday',
  45. 'Sunday'
  46. ]
  47. },
  48. yAxis: {
  49. title: {
  50. text: 'Number of units'
  51. },
  52. labels: {
  53. formatter: function () {
  54. return this.value;
  55. }
  56. },
  57. min: 0
  58. },
  59. plotOptions: {
  60. area: {
  61. fillOpacity: 0.5
  62. }
  63. },
  64. series: [{
  65. name: 'John',
  66. data: [3, 4, 3, 5, 4, 10, 12]
  67. }, {
  68. name: 'Jane',
  69. data: [1, 3, 4, 3, 3, 5, 4]
  70. }]
  71. });
  72. });
  73. </script>
  74. </head>
  75. <body>
  76. <script src="../../js/highcharts.js"></script>
  77. <script src="../../js/modules/exporting.js"></script>
  78. <div id="container" style="min-width: 310px; height: 400px; max-width: 600px; margin: 0 auto"></div>
  79. </body>
  80. </html>