area-with-missing-data.html 6.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236
  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>Area with missing data</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. <script>
  16. window.Promise ||
  17. document.write(
  18. '<script src="https://cdn.jsdelivr.net/npm/promise-polyfill@8/dist/polyfill.min.js"><\/script>'
  19. )
  20. window.Promise ||
  21. document.write(
  22. '<script src="https://cdn.jsdelivr.net/npm/eligrey-classlist-js-polyfill@1.2.20171210/classList.min.js"><\/script>'
  23. )
  24. window.Promise ||
  25. document.write(
  26. '<script src="https://cdn.jsdelivr.net/npm/findindex_polyfill_mdn"><\/script>'
  27. )
  28. </script>
  29. <script src="https://cdn.jsdelivr.net/npm/react@16.12/umd/react.production.min.js"></script>
  30. <script src="https://cdn.jsdelivr.net/npm/react-dom@16.12/umd/react-dom.production.min.js"></script>
  31. <script src="https://cdn.jsdelivr.net/npm/prop-types@15.7.2/prop-types.min.js"></script>
  32. <script src="https://cdnjs.cloudflare.com/ajax/libs/babel-core/5.8.34/browser.min.js"></script>
  33. <script src="https://cdn.jsdelivr.net/npm/apexcharts"></script>
  34. <script src="https://cdn.jsdelivr.net/npm/react-apexcharts@1.3.6/dist/react-apexcharts.iife.min.js"></script>
  35. </head>
  36. <body>
  37. <div id="app"></div>
  38. <div id="html">
  39. &lt;div id=&quot;chart&quot;&gt;
  40. &lt;ReactApexChart options={this.state.options} series={this.state.series} type=&quot;area&quot; height={350} /&gt;
  41. &lt;/div&gt;
  42. </div>
  43. <script type="text/babel">
  44. class ApexChart extends React.Component {
  45. constructor(props) {
  46. super(props);
  47. this.state = {
  48. series: [{
  49. name: 'Network',
  50. data: [{
  51. x: 'Dec 23 2017',
  52. y: null
  53. },
  54. {
  55. x: 'Dec 24 2017',
  56. y: 44
  57. },
  58. {
  59. x: 'Dec 25 2017',
  60. y: 31
  61. },
  62. {
  63. x: 'Dec 26 2017',
  64. y: 38
  65. },
  66. {
  67. x: 'Dec 27 2017',
  68. y: null
  69. },
  70. {
  71. x: 'Dec 28 2017',
  72. y: 32
  73. },
  74. {
  75. x: 'Dec 29 2017',
  76. y: 55
  77. },
  78. {
  79. x: 'Dec 30 2017',
  80. y: 51
  81. },
  82. {
  83. x: 'Dec 31 2017',
  84. y: 67
  85. },
  86. {
  87. x: 'Jan 01 2018',
  88. y: 22
  89. },
  90. {
  91. x: 'Jan 02 2018',
  92. y: 34
  93. },
  94. {
  95. x: 'Jan 03 2018',
  96. y: null
  97. },
  98. {
  99. x: 'Jan 04 2018',
  100. y: null
  101. },
  102. {
  103. x: 'Jan 05 2018',
  104. y: 11
  105. },
  106. {
  107. x: 'Jan 06 2018',
  108. y: 4
  109. },
  110. {
  111. x: 'Jan 07 2018',
  112. y: 15,
  113. },
  114. {
  115. x: 'Jan 08 2018',
  116. y: null
  117. },
  118. {
  119. x: 'Jan 09 2018',
  120. y: 9
  121. },
  122. {
  123. x: 'Jan 10 2018',
  124. y: 34
  125. },
  126. {
  127. x: 'Jan 11 2018',
  128. y: null
  129. },
  130. {
  131. x: 'Jan 12 2018',
  132. y: null
  133. },
  134. {
  135. x: 'Jan 13 2018',
  136. y: 13
  137. },
  138. {
  139. x: 'Jan 14 2018',
  140. y: null
  141. }
  142. ],
  143. }],
  144. options: {
  145. chart: {
  146. type: 'area',
  147. height: 350,
  148. animations: {
  149. enabled: false
  150. },
  151. zoom: {
  152. enabled: false
  153. },
  154. },
  155. dataLabels: {
  156. enabled: false
  157. },
  158. stroke: {
  159. curve: 'straight'
  160. },
  161. fill: {
  162. opacity: 0.8,
  163. type: 'pattern',
  164. pattern: {
  165. style: ['verticalLines', 'horizontalLines'],
  166. width: 5,
  167. height: 6
  168. },
  169. },
  170. markers: {
  171. size: 5,
  172. hover: {
  173. size: 9
  174. }
  175. },
  176. title: {
  177. text: 'Network Monitoring',
  178. },
  179. tooltip: {
  180. intersect: true,
  181. shared: false
  182. },
  183. theme: {
  184. palette: 'palette1'
  185. },
  186. xaxis: {
  187. type: 'datetime',
  188. },
  189. yaxis: {
  190. title: {
  191. text: 'Bytes Received'
  192. }
  193. }
  194. },
  195. };
  196. }
  197. render() {
  198. return (
  199. <div>
  200. <div id="chart">
  201. <ReactApexChart options={this.state.options} series={this.state.series} type="area" height={350} />
  202. </div>
  203. <div id="html-dist"></div>
  204. </div>
  205. );
  206. }
  207. }
  208. const domContainer = document.querySelector('#app');
  209. ReactDOM.render(React.createElement(ApexChart), domContainer);
  210. </script>
  211. </body>
  212. </html>