index.htm 3.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142
  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="https://code.jquery.com/jquery-3.1.1.min.js"></script>
  12. <script src="../../code/highcharts.js"></script>
  13. <script src="../../code/modules/data.js"></script>
  14. <script src="../../code/modules/series-label.js"></script>
  15. <script src="../../code/modules/exporting.js"></script>
  16. <script src="../../code/modules/export-data.js"></script>
  17. <!-- Additional files for the Highslide popup effect -->
  18. <script src="https://www.highcharts.com/media/com_demo/js/highslide-full.min.js"></script>
  19. <script src="https://www.highcharts.com/media/com_demo/js/highslide.config.js" charset="utf-8"></script>
  20. <link rel="stylesheet" type="text/css" href="https://www.highcharts.com/media/com_demo/css/highslide.css" />
  21. <div id="container" style="min-width: 310px; height: 400px; margin: 0 auto"></div>
  22. <script type="text/javascript">
  23. Highcharts.chart('container', {
  24. chart: {
  25. scrollablePlotArea: {
  26. minWidth: 700
  27. }
  28. },
  29. data: {
  30. csvURL: 'https://cdn.rawgit.com/highcharts/highcharts/' +
  31. '057b672172ccc6c08fe7dbb27fc17ebca3f5b770/samples/data/analytics.csv',
  32. beforeParse: function (csv) {
  33. return csv.replace(/\n\n/g, '\n');
  34. }
  35. },
  36. title: {
  37. text: 'Daily sessions at www.highcharts.com'
  38. },
  39. subtitle: {
  40. text: 'Source: Google Analytics'
  41. },
  42. xAxis: {
  43. tickInterval: 7 * 24 * 3600 * 1000, // one week
  44. tickWidth: 0,
  45. gridLineWidth: 1,
  46. labels: {
  47. align: 'left',
  48. x: 3,
  49. y: -3
  50. }
  51. },
  52. yAxis: [{ // left y axis
  53. title: {
  54. text: null
  55. },
  56. labels: {
  57. align: 'left',
  58. x: 3,
  59. y: 16,
  60. format: '{value:.,0f}'
  61. },
  62. showFirstLabel: false
  63. }, { // right y axis
  64. linkedTo: 0,
  65. gridLineWidth: 0,
  66. opposite: true,
  67. title: {
  68. text: null
  69. },
  70. labels: {
  71. align: 'right',
  72. x: -3,
  73. y: 16,
  74. format: '{value:.,0f}'
  75. },
  76. showFirstLabel: false
  77. }],
  78. legend: {
  79. align: 'left',
  80. verticalAlign: 'top',
  81. borderWidth: 0
  82. },
  83. tooltip: {
  84. shared: true,
  85. crosshairs: true
  86. },
  87. plotOptions: {
  88. series: {
  89. cursor: 'pointer',
  90. point: {
  91. events: {
  92. click: function (e) {
  93. hs.htmlExpand(null, {
  94. pageOrigin: {
  95. x: e.pageX || e.clientX,
  96. y: e.pageY || e.clientY
  97. },
  98. headingText: this.series.name,
  99. maincontentText: Highcharts.dateFormat('%A, %b %e, %Y', this.x) + ':<br/> ' +
  100. this.y + ' sessions',
  101. width: 200
  102. });
  103. }
  104. }
  105. },
  106. marker: {
  107. lineWidth: 1
  108. }
  109. }
  110. },
  111. series: [{
  112. name: 'All sessions',
  113. lineWidth: 4,
  114. marker: {
  115. radius: 4
  116. }
  117. }, {
  118. name: 'New users'
  119. }]
  120. });
  121. </script>
  122. </body>
  123. </html>