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.

81 lines
2.0 KiB

8 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: 'areaspline'
  15. },
  16. title: {
  17. text: 'Average fruit consumption during one week'
  18. },
  19. legend: {
  20. layout: 'vertical',
  21. align: 'left',
  22. verticalAlign: 'top',
  23. x: 150,
  24. y: 100,
  25. floating: true,
  26. borderWidth: 1,
  27. backgroundColor: (Highcharts.theme && Highcharts.theme.legendBackgroundColor) || '#FFFFFF'
  28. },
  29. xAxis: {
  30. categories: [
  31. 'Monday',
  32. 'Tuesday',
  33. 'Wednesday',
  34. 'Thursday',
  35. 'Friday',
  36. 'Saturday',
  37. 'Sunday'
  38. ],
  39. plotBands: [{ // visualize the weekend
  40. from: 4.5,
  41. to: 6.5,
  42. color: 'rgba(68, 170, 213, .2)'
  43. }]
  44. },
  45. yAxis: {
  46. title: {
  47. text: 'Fruit units'
  48. }
  49. },
  50. tooltip: {
  51. shared: true,
  52. valueSuffix: ' units'
  53. },
  54. credits: {
  55. enabled: false
  56. },
  57. plotOptions: {
  58. areaspline: {
  59. fillOpacity: 0.5
  60. }
  61. },
  62. series: [{
  63. name: 'John',
  64. data: [3, 4, 3, 5, 4, 10, 12]
  65. }, {
  66. name: 'Jane',
  67. data: [1, 3, 4, 3, 3, 5, 4]
  68. }]
  69. });
  70. });
  71. </script>
  72. </head>
  73. <body>
  74. <script src="../../js/highcharts.js"></script>
  75. <script src="../../js/modules/exporting.js"></script>
  76. <div id="container" style="min-width: 310px; height: 400px; margin: 0 auto"></div>
  77. </body>
  78. </html>