You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

81 lines
2.3 KiB

9 years ago
  1. <!DOCTYPE HTML>
  2. <html>
  3. <head>
  4. <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
  5. <title>Highcharts Example</title>
  6. <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.8.2/jquery.min.js"></script>
  7. <style type="text/css">
  8. ${demo.css}
  9. </style>
  10. <script type="text/javascript">
  11. $(function () {
  12. $.getJSON('http://www.highcharts.com/samples/data/jsonp.php?filename=usdeur.json&callback=?', function (data) {
  13. $('#container').highcharts({
  14. chart: {
  15. zoomType: 'x'
  16. },
  17. title: {
  18. text: 'USD to EUR exchange rate over time'
  19. },
  20. subtitle: {
  21. text: document.ontouchstart === undefined ?
  22. 'Click and drag in the plot area to zoom in' : 'Pinch the chart to zoom in'
  23. },
  24. xAxis: {
  25. type: 'datetime'
  26. },
  27. yAxis: {
  28. title: {
  29. text: 'Exchange rate'
  30. }
  31. },
  32. legend: {
  33. enabled: false
  34. },
  35. plotOptions: {
  36. area: {
  37. fillColor: {
  38. linearGradient: {
  39. x1: 0,
  40. y1: 0,
  41. x2: 0,
  42. y2: 1
  43. },
  44. stops: [
  45. [0, Highcharts.getOptions().colors[0]],
  46. [1, Highcharts.Color(Highcharts.getOptions().colors[0]).setOpacity(0).get('rgba')]
  47. ]
  48. },
  49. marker: {
  50. radius: 2
  51. },
  52. lineWidth: 1,
  53. states: {
  54. hover: {
  55. lineWidth: 1
  56. }
  57. },
  58. threshold: null
  59. }
  60. },
  61. series: [{
  62. type: 'area',
  63. name: 'USD to EUR',
  64. data: data
  65. }]
  66. });
  67. });
  68. });
  69. </script>
  70. </head>
  71. <body>
  72. <script src="../../js/highcharts.js"></script>
  73. <script src="../../js/modules/exporting.js"></script>
  74. <div id="container" style="min-width: 310px; height: 400px; margin: 0 auto"></div>
  75. </body>
  76. </html>