area-range.html 3.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141
  1. <!DOCTYPE html>
  2. <html lang="en">
  3. <head>
  4. <meta charset="UTF-8">
  5. <meta name="viewport" content="width=device-width, initial-scale=1.0">
  6. <meta http-equiv="X-UA-Compatible" content="ie=edge">
  7. <title>Range Area Chart</title>
  8. <link href="../../assets/styles.css" rel="stylesheet" />
  9. <style>
  10. #chart {
  11. max-width: 650px;
  12. margin: 35px auto;
  13. }
  14. </style>
  15. </head>
  16. <body>
  17. <div id="chart">
  18. </div>
  19. <script src="https://cdn.jsdelivr.net/npm/apexcharts@latest"></script>
  20. <script>
  21. var options = {
  22. chart: {
  23. height: 350,
  24. type: 'area',
  25. },
  26. dataLabels: {
  27. enabled: false
  28. },
  29. plotOptions: {
  30. area: {
  31. isRange: true
  32. }
  33. },
  34. stroke: {
  35. curve: 'straight'
  36. },
  37. series: [{
  38. name: 'range',
  39. data: [
  40. {
  41. x: new Date(1538780400000),
  42. y: [6632.01, 6643.59]
  43. },
  44. {
  45. x: new Date(1538782200000),
  46. y: [6630.71, 6648.95]
  47. },
  48. {
  49. x: new Date(1538784000000),
  50. y: [6635.65, 6651]
  51. },
  52. {
  53. x: new Date(1538785800000),
  54. y: [6638.24, 6640]
  55. },
  56. {
  57. x: new Date(1538787600000),
  58. y: [6624.53, 6636.03]
  59. },
  60. {
  61. x: new Date(1538789400000),
  62. y: [6624.61, 6632.2]
  63. },
  64. {
  65. x: new Date(1538791200000),
  66. y: [6617, 6627.62]
  67. },
  68. {
  69. x: new Date(1538793000000),
  70. y: [6605, 6608.03]
  71. },
  72. {
  73. x: new Date(1538794800000),
  74. y: [6604.5, 6614.4]
  75. },
  76. {
  77. x: new Date(1538796600000),
  78. y: [6608.02, 6610.68]
  79. },
  80. {
  81. x: new Date(1538798400000),
  82. y: [6608.91, 6618.99]
  83. },
  84. {
  85. x: new Date(1538800200000),
  86. y: [6612, 6615.13]
  87. },
  88. {
  89. x: new Date(1538802000000),
  90. y: [6612, 6624.12]
  91. },
  92. {
  93. x: new Date(1538803800000),
  94. y: [6603.91, 6623.91]
  95. },
  96. {
  97. x: new Date(1538805600000),
  98. y: [6611.69, 6618.74]
  99. },
  100. {
  101. x: new Date(1538807400000),
  102. y: [6611, 6622.78]
  103. },
  104. {
  105. x: new Date(1538809200000),
  106. y: [6614.9, 6626.2]
  107. }
  108. ]
  109. }],
  110. title: {
  111. text: 'Range Area Chart',
  112. align: 'left',
  113. style: {
  114. fontSize: '16px'
  115. }
  116. },
  117. xaxis: {
  118. type: 'datetime',
  119. },
  120. }
  121. var chart = new ApexCharts(
  122. document.querySelector("#chart"),
  123. options
  124. );
  125. chart.render();
  126. </script>
  127. </body>
  128. </html>