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.2 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. spacingBottom: 30
  16. },
  17. title: {
  18. text: 'Fruit consumption *'
  19. },
  20. subtitle: {
  21. text: '* Jane\'s banana consumption is unknown',
  22. floating: true,
  23. align: 'right',
  24. verticalAlign: 'bottom',
  25. y: 15
  26. },
  27. legend: {
  28. layout: 'vertical',
  29. align: 'left',
  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: ['Apples', 'Pears', 'Oranges', 'Bananas', 'Grapes', 'Plums', 'Strawberries', 'Raspberries']
  39. },
  40. yAxis: {
  41. title: {
  42. text: 'Y-Axis'
  43. },
  44. labels: {
  45. formatter: function () {
  46. return this.value;
  47. }
  48. }
  49. },
  50. tooltip: {
  51. formatter: function () {
  52. return '<b>' + this.series.name + '</b><br/>' +
  53. this.x + ': ' + this.y;
  54. }
  55. },
  56. plotOptions: {
  57. area: {
  58. fillOpacity: 0.5
  59. }
  60. },
  61. credits: {
  62. enabled: false
  63. },
  64. series: [{
  65. name: 'John',
  66. data: [0, 1, 4, 4, 5, 2, 3, 7]
  67. }, {
  68. name: 'Jane',
  69. data: [1, 0, 3, null, 3, 1, 2, 1]
  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; margin: 0 auto"></div>
  79. </body>
  80. </html>