index.htm 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  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>Highstock Example</title>
  7. <style type="text/css">
  8. </style>
  9. </head>
  10. <body>
  11. <script src="../../code/highstock.js"></script>
  12. <script src="../../code/modules/data.js"></script>
  13. <script src="../../code/modules/exporting.js"></script>
  14. <div id="container" style="height: 400px; min-width: 310px"></div>
  15. <script type="text/javascript">
  16. Highcharts.getJSON('https://www.highcharts.com/samples/data/aapl-ohlc.json', function (data) {
  17. // create the chart
  18. Highcharts.stockChart('container', {
  19. rangeSelector: {
  20. selected: 2
  21. },
  22. title: {
  23. text: 'AAPL Stock Price'
  24. },
  25. series: [{
  26. type: 'ohlc',
  27. name: 'AAPL Stock Price',
  28. data: data,
  29. dataGrouping: {
  30. units: [[
  31. 'week', // unit name
  32. [1] // allowed multiples
  33. ], [
  34. 'month',
  35. [1, 2, 3, 4, 6]
  36. ]]
  37. }
  38. }]
  39. });
  40. });
  41. </script>
  42. </body>
  43. </html>