circle-chart-multiple.html 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104
  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 - Multiple</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: [44, 55, 67, 83],
  54. chartOptions: {
  55. chart: {
  56. height: 350,
  57. type: 'radialBar',
  58. },
  59. plotOptions: {
  60. radialBar: {
  61. dataLabels: {
  62. name: {
  63. fontSize: '22px',
  64. },
  65. value: {
  66. fontSize: '16px',
  67. },
  68. total: {
  69. show: true,
  70. label: 'Total',
  71. formatter: function (w) {
  72. // By default this function returns the average of all series. The below is just an example to show the use of custom formatter function
  73. return 249
  74. }
  75. }
  76. }
  77. }
  78. },
  79. labels: ['Apples', 'Oranges', 'Bananas', 'Berries'],
  80. },
  81. },
  82. })
  83. </script>
  84. </body>
  85. </html>