basic-line.html 2.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788
  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>Basic Line 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. <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/apexcharts"></script>
  30. </head>
  31. <body>
  32. <div id="chart"></div>
  33. <script>
  34. var options = {
  35. series: [{
  36. name: "Desktops",
  37. data: [10, 41, 35, 51, 49, 62, 69, 91, 148]
  38. }],
  39. chart: {
  40. height: 350,
  41. type: 'line',
  42. zoom: {
  43. enabled: false
  44. }
  45. },
  46. dataLabels: {
  47. enabled: false
  48. },
  49. stroke: {
  50. curve: 'straight'
  51. },
  52. title: {
  53. text: 'Product Trends by Month',
  54. align: 'left'
  55. },
  56. grid: {
  57. row: {
  58. colors: ['#f3f3f3', 'transparent'], // takes an array which will be repeated on columns
  59. opacity: 0.5
  60. },
  61. },
  62. xaxis: {
  63. categories: ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep'],
  64. }
  65. };
  66. var chart = new ApexCharts(document.querySelector("#chart"), options);
  67. chart.render();
  68. </script>
  69. </body>
  70. </html>