index.htm 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  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. <script src="../../code/modules/export-data.js"></script>
  15. <div id="container" style="height: 400px; min-width: 310px"></div>
  16. <script type="text/javascript">
  17. Highcharts.getJSON('https://www.highcharts.com/samples/data/aapl-c.json', function (data) {
  18. // Create the chart
  19. Highcharts.stockChart('container', {
  20. rangeSelector: {
  21. selected: 1
  22. },
  23. title: {
  24. text: 'AAPL Stock Price'
  25. },
  26. series: [{
  27. name: 'AAPL Stock Price',
  28. data: data,
  29. type: 'area',
  30. threshold: null,
  31. tooltip: {
  32. valueDecimals: 2
  33. },
  34. fillColor: {
  35. linearGradient: {
  36. x1: 0,
  37. y1: 0,
  38. x2: 0,
  39. y2: 1
  40. },
  41. stops: [
  42. [0, Highcharts.getOptions().colors[0]],
  43. [1, Highcharts.color(Highcharts.getOptions().colors[0]).setOpacity(0).get('rgba')]
  44. ]
  45. }
  46. }]
  47. });
  48. });
  49. </script>
  50. </body>
  51. </html>