index.htm 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  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: 1
  21. },
  22. title: {
  23. text: 'AAPL Stock Price'
  24. },
  25. series: [{
  26. type: 'candlestick',
  27. name: 'AAPL Stock Price',
  28. data: data,
  29. dataGrouping: {
  30. units: [
  31. [
  32. 'week', // unit name
  33. [1] // allowed multiples
  34. ], [
  35. 'month',
  36. [1, 2, 3, 4, 6]
  37. ]
  38. ]
  39. }
  40. }]
  41. });
  42. });
  43. </script>
  44. </body>
  45. </html>