circle-chart-with-image.html 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117
  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>Circle Gauge Chart</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/vue/dist/vue.min.js"></script>
  31. <script src="https://cdn.jsdelivr.net/npm/apexcharts"></script>
  32. <script src="https://cdn.jsdelivr.net/npm/vue-apexcharts"></script>
  33. </head>
  34. <body>
  35. <div id="app">
  36. <div id="chart">
  37. <apexchart type="radialBar" height="350" :options="chartOptions" :series="series"></apexchart>
  38. </div>
  39. </div>
  40. <!-- Below element is just for displaying source code. it is not required. DO NOT USE -->
  41. <div id="html">
  42. &lt;div id=&quot;chart&quot;&gt;
  43. &lt;apexchart type=&quot;radialBar&quot; height=&quot;350&quot; :options=&quot;chartOptions&quot; :series=&quot;series&quot;&gt;&lt;/apexchart&gt;
  44. &lt;/div&gt;
  45. </div>
  46. <script>
  47. new Vue({
  48. el: '#app',
  49. components: {
  50. apexchart: VueApexCharts,
  51. },
  52. data: {
  53. series: [67],
  54. chartOptions: {
  55. chart: {
  56. height: 350,
  57. type: 'radialBar',
  58. },
  59. plotOptions: {
  60. radialBar: {
  61. hollow: {
  62. margin: 15,
  63. size: '70%',
  64. image: '../../assets/images/clock.png',
  65. imageWidth: 64,
  66. imageHeight: 64,
  67. imageClipped: false
  68. },
  69. dataLabels: {
  70. name: {
  71. show: false,
  72. color: '#fff'
  73. },
  74. value: {
  75. show: true,
  76. color: '#333',
  77. offsetY: 70,
  78. fontSize: '22px'
  79. }
  80. }
  81. }
  82. },
  83. fill: {
  84. type: 'image',
  85. image: {
  86. src: ['../../assets/images/4274635880_809a4b9d0d_z.jpg'],
  87. }
  88. },
  89. stroke: {
  90. lineCap: 'round'
  91. },
  92. labels: ['Volatility'],
  93. },
  94. },
  95. })
  96. </script>
  97. </body>
  98. </html>