stroked-gauge.html 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101
  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>Stroked Gauge</title>
  8. <link href="../../assets/styles.css" rel="stylesheet" />
  9. <style>
  10. #chart {
  11. padding: 0;
  12. max-width: 650px;
  13. margin: 35px auto;
  14. }
  15. </style>
  16. <script>
  17. window.Promise ||
  18. document.write(
  19. '<script src="https://cdn.jsdelivr.net/npm/promise-polyfill@8/dist/polyfill.min.js"><\/script>'
  20. )
  21. window.Promise ||
  22. document.write(
  23. '<script src="https://cdn.jsdelivr.net/npm/eligrey-classlist-js-polyfill@1.2.20171210/classList.min.js"><\/script>'
  24. )
  25. window.Promise ||
  26. document.write(
  27. '<script src="https://cdn.jsdelivr.net/npm/findindex_polyfill_mdn"><\/script>'
  28. )
  29. </script>
  30. <script src="https://cdn.jsdelivr.net/npm/apexcharts"></script>
  31. </head>
  32. <body>
  33. <div id="chart"></div>
  34. <script>
  35. var options = {
  36. series: [67],
  37. chart: {
  38. height: 350,
  39. type: 'radialBar',
  40. offsetY: -10
  41. },
  42. plotOptions: {
  43. radialBar: {
  44. startAngle: -135,
  45. endAngle: 135,
  46. dataLabels: {
  47. name: {
  48. fontSize: '16px',
  49. color: undefined,
  50. offsetY: 120
  51. },
  52. value: {
  53. offsetY: 76,
  54. fontSize: '22px',
  55. color: undefined,
  56. formatter: function (val) {
  57. return val + "%";
  58. }
  59. }
  60. }
  61. }
  62. },
  63. fill: {
  64. type: 'gradient',
  65. gradient: {
  66. shade: 'dark',
  67. shadeIntensity: 0.15,
  68. inverseColors: false,
  69. opacityFrom: 1,
  70. opacityTo: 1,
  71. stops: [0, 50, 65, 91]
  72. },
  73. },
  74. stroke: {
  75. dashArray: 4
  76. },
  77. labels: ['Median Ratio'],
  78. };
  79. var chart = new ApexCharts(document.querySelector("#chart"), options);
  80. chart.render();
  81. </script>
  82. </body>
  83. </html>