scatter-images.html 5.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181
  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>Scatter - Image Chart</title>
  8. <link href="../../assets/styles.css" rel="stylesheet" />
  9. <style>
  10. #chart {
  11. max-width: 650px;
  12. margin: 35px auto;
  13. }
  14. .apexcharts-legend {
  15. overflow: hidden !important;
  16. min-height: 17px;
  17. }
  18. .apexcharts-legend-marker {
  19. background: none !important;
  20. margin-right: 7px !important;
  21. }
  22. .apexcharts-legend-series {
  23. align-items: flex-start !important;
  24. }
  25. </style>
  26. <script>
  27. window.Promise ||
  28. document.write(
  29. '<script src="https://cdn.jsdelivr.net/npm/promise-polyfill@8/dist/polyfill.min.js"><\/script>'
  30. )
  31. window.Promise ||
  32. document.write(
  33. '<script src="https://cdn.jsdelivr.net/npm/eligrey-classlist-js-polyfill@1.2.20171210/classList.min.js"><\/script>'
  34. )
  35. window.Promise ||
  36. document.write(
  37. '<script src="https://cdn.jsdelivr.net/npm/findindex_polyfill_mdn"><\/script>'
  38. )
  39. </script>
  40. <script src="https://cdn.jsdelivr.net/npm/vue/dist/vue.min.js"></script>
  41. <script src="https://cdn.jsdelivr.net/npm/apexcharts"></script>
  42. <script src="https://cdn.jsdelivr.net/npm/vue-apexcharts"></script>
  43. <link href="../../assets/styles.css" rel="stylesheet" />
  44. <link rel="stylesheet" href="https://use.fontawesome.com/releases/v5.5.0/css/brands.css" integrity="sha384-QT2Z8ljl3UupqMtQNmPyhSPO/d5qbrzWmFxJqmY7tqoTuT2YrQLEqzvVOP2cT5XW" crossorigin="anonymous">
  45. <link rel="stylesheet" href="https://use.fontawesome.com/releases/v5.5.0/css/fontawesome.css" integrity="sha384-u5J7JghGz0qUrmEsWzBQkfvc8nK3fUT7DCaQzNQ+q4oEXhGSx+P2OqjWsfIRB8QT" crossorigin="anonymous">
  46. </head>
  47. <body>
  48. <div id="app">
  49. <div id="chart">
  50. <apexchart type="scatter" height="350" :options="chartOptions" :series="series"></apexchart>
  51. </div>
  52. </div>
  53. <!-- Below element is just for displaying source code. it is not required. DO NOT USE -->
  54. <div id="html">
  55. &lt;div id=&quot;chart&quot;&gt;
  56. &lt;apexchart type=&quot;scatter&quot; height=&quot;350&quot; :options=&quot;chartOptions&quot; :series=&quot;series&quot;&gt;&lt;/apexchart&gt;
  57. &lt;/div&gt;
  58. </div>
  59. <script>
  60. new Vue({
  61. el: '#app',
  62. components: {
  63. apexchart: VueApexCharts,
  64. },
  65. data: {
  66. series: [{
  67. name: 'Messenger',
  68. data: [
  69. [16.4, 5.4],
  70. [21.7, 4],
  71. [25.4, 3],
  72. [19, 2],
  73. [10.9, 1],
  74. [13.6, 3.2],
  75. [10.9, 7],
  76. [10.9, 8.2],
  77. [16.4, 4],
  78. [13.6, 4.3],
  79. [13.6, 12],
  80. [29.9, 3],
  81. [10.9, 5.2],
  82. [16.4, 6.5],
  83. [10.9, 8],
  84. [24.5, 7.1],
  85. [10.9, 7],
  86. [8.1, 4.7],
  87. [19, 10],
  88. [27.1, 10],
  89. [24.5, 8],
  90. [27.1, 3],
  91. [29.9, 11.5],
  92. [27.1, 0.8],
  93. [22.1, 2]
  94. ]
  95. }, {
  96. name: 'Instagram',
  97. data: [
  98. [6.4, 5.4],
  99. [11.7, 4],
  100. [15.4, 3],
  101. [9, 2],
  102. [10.9, 11],
  103. [20.9, 7],
  104. [12.9, 8.2],
  105. [6.4, 14],
  106. [11.6, 12]
  107. ]
  108. }],
  109. chartOptions: {
  110. chart: {
  111. height: 350,
  112. type: 'scatter',
  113. animations: {
  114. enabled: false,
  115. },
  116. zoom: {
  117. enabled: false,
  118. },
  119. toolbar: {
  120. show: false
  121. }
  122. },
  123. colors: ['#056BF6', '#D2376A'],
  124. xaxis: {
  125. tickAmount: 10,
  126. min: 0,
  127. max: 40
  128. },
  129. yaxis: {
  130. tickAmount: 7
  131. },
  132. markers: {
  133. size: 20
  134. },
  135. fill: {
  136. type: 'image',
  137. opacity: 1,
  138. image: {
  139. src: ['../../assets/images/ico-messenger.png', '../../assets/images/ico-instagram.png'],
  140. width: 40,
  141. height: 40
  142. }
  143. },
  144. legend: {
  145. labels: {
  146. useSeriesColors: true
  147. },
  148. markers: {
  149. customHTML: [
  150. function() {
  151. return '<span><i class="fab fa-facebook"></i></span>'
  152. }, function() {
  153. return '<span><i class="fab fa-instagram"></i></span>'
  154. }
  155. ]
  156. }
  157. }
  158. },
  159. },
  160. })
  161. </script>
  162. </body>
  163. </html>