index.htm 2.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798
  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/drag-panes.js"></script>
  14. <script src="../../code/modules/exporting.js"></script>
  15. <script src="../../code/indicators/indicators.js"></script>
  16. <script src="../../code/indicators/pivot-points.js"></script>
  17. <script src="../../code/indicators/ema.js"></script>
  18. <script src="../../code/indicators/macd.js"></script>
  19. <div id="container" style="height: 600px; min-width: 310px"></div>
  20. <script type="text/javascript">
  21. Highcharts.getJSON('https://www.highcharts.com/samples/data/aapl-ohlc.json', function (data) {
  22. Highcharts.stockChart('container', {
  23. rangeSelector: {
  24. selected: 2
  25. },
  26. yAxis: [{
  27. height: '75%',
  28. resize: {
  29. enabled: true
  30. },
  31. labels: {
  32. align: 'right',
  33. x: -3
  34. },
  35. title: {
  36. text: 'AAPL'
  37. }
  38. }, {
  39. top: '75%',
  40. height: '25%',
  41. labels: {
  42. align: 'right',
  43. x: -3
  44. },
  45. offset: 0,
  46. title: {
  47. text: 'MACD'
  48. }
  49. }],
  50. title: {
  51. text: 'AAPL Stock Price'
  52. },
  53. subtitle: {
  54. text: 'With MACD and Pivot Points technical indicators'
  55. },
  56. series: [{
  57. type: 'ohlc',
  58. id: 'aapl',
  59. name: 'AAPL Stock Price',
  60. data: data,
  61. zIndex: 1
  62. }, {
  63. type: 'pivotpoints',
  64. linkedTo: 'aapl',
  65. zIndex: 0,
  66. lineWidth: 1,
  67. dataLabels: {
  68. overflow: 'none',
  69. crop: false,
  70. y: 4,
  71. style: {
  72. fontSize: 9
  73. }
  74. }
  75. }, {
  76. type: 'macd',
  77. yAxis: 1,
  78. linkedTo: 'aapl'
  79. }]
  80. });
  81. });
  82. </script>
  83. </body>
  84. </html>