main.js 8.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340
  1. "use strict";
  2. /* eslint-disable object-shorthand */
  3. /* global Chart, CustomTooltips, getStyle, hexToRgba */
  4. /**
  5. * --------------------------------------------------------------------------
  6. * CoreUI Free Boostrap Admin Template (v2.1.15): main.js
  7. * Licensed under MIT (https://coreui.io/license)
  8. * --------------------------------------------------------------------------
  9. */
  10. /* eslint-disable no-magic-numbers */
  11. // Disable the on-canvas tooltip
  12. Chart.defaults.global.pointHitDetectionRadius = 1;
  13. Chart.defaults.global.tooltips.enabled = false;
  14. Chart.defaults.global.tooltips.mode = 'index';
  15. Chart.defaults.global.tooltips.position = 'nearest';
  16. Chart.defaults.global.tooltips.custom = CustomTooltips;
  17. Chart.defaults.global.tooltips.intersect = true;
  18. Chart.defaults.global.tooltips.callbacks.labelColor = function (tooltipItem, chart) {
  19. return {
  20. backgroundColor: chart.data.datasets[tooltipItem.datasetIndex].borderColor
  21. };
  22. }; // eslint-disable-next-line no-unused-vars
  23. var cardChart1 = new Chart($('#card-chart1'), {
  24. type: 'line',
  25. data: {
  26. labels: ['January', 'February', 'March', 'April', 'May', 'June', 'July'],
  27. datasets: [{
  28. label: 'My First dataset',
  29. backgroundColor: getStyle('--primary'),
  30. borderColor: 'rgba(255,255,255,.55)',
  31. data: [65, 59, 84, 84, 51, 55, 40]
  32. }]
  33. },
  34. options: {
  35. maintainAspectRatio: false,
  36. legend: {
  37. display: false
  38. },
  39. scales: {
  40. xAxes: [{
  41. gridLines: {
  42. color: 'transparent',
  43. zeroLineColor: 'transparent'
  44. },
  45. ticks: {
  46. fontSize: 2,
  47. fontColor: 'transparent'
  48. }
  49. }],
  50. yAxes: [{
  51. display: false,
  52. ticks: {
  53. display: false,
  54. min: 35,
  55. max: 89
  56. }
  57. }]
  58. },
  59. elements: {
  60. line: {
  61. borderWidth: 1
  62. },
  63. point: {
  64. radius: 4,
  65. hitRadius: 10,
  66. hoverRadius: 4
  67. }
  68. }
  69. }
  70. }); // eslint-disable-next-line no-unused-vars
  71. var cardChart2 = new Chart($('#card-chart2'), {
  72. type: 'line',
  73. data: {
  74. labels: ['January', 'February', 'March', 'April', 'May', 'June', 'July'],
  75. datasets: [{
  76. label: 'My First dataset',
  77. backgroundColor: getStyle('--info'),
  78. borderColor: 'rgba(255,255,255,.55)',
  79. data: [1, 18, 9, 17, 34, 22, 11]
  80. }]
  81. },
  82. options: {
  83. maintainAspectRatio: false,
  84. legend: {
  85. display: false
  86. },
  87. scales: {
  88. xAxes: [{
  89. gridLines: {
  90. color: 'transparent',
  91. zeroLineColor: 'transparent'
  92. },
  93. ticks: {
  94. fontSize: 2,
  95. fontColor: 'transparent'
  96. }
  97. }],
  98. yAxes: [{
  99. display: false,
  100. ticks: {
  101. display: false,
  102. min: -4,
  103. max: 39
  104. }
  105. }]
  106. },
  107. elements: {
  108. line: {
  109. tension: 0.00001,
  110. borderWidth: 1
  111. },
  112. point: {
  113. radius: 4,
  114. hitRadius: 10,
  115. hoverRadius: 4
  116. }
  117. }
  118. }
  119. }); // eslint-disable-next-line no-unused-vars
  120. var cardChart3 = new Chart($('#card-chart3'), {
  121. type: 'line',
  122. data: {
  123. labels: ['January', 'February', 'March', 'April', 'May', 'June', 'July'],
  124. datasets: [{
  125. label: 'My First dataset',
  126. backgroundColor: 'rgba(255,255,255,.2)',
  127. borderColor: 'rgba(255,255,255,.55)',
  128. data: [78, 81, 80, 45, 34, 12, 40]
  129. }]
  130. },
  131. options: {
  132. maintainAspectRatio: false,
  133. legend: {
  134. display: false
  135. },
  136. scales: {
  137. xAxes: [{
  138. display: false
  139. }],
  140. yAxes: [{
  141. display: false
  142. }]
  143. },
  144. elements: {
  145. line: {
  146. borderWidth: 2
  147. },
  148. point: {
  149. radius: 0,
  150. hitRadius: 10,
  151. hoverRadius: 4
  152. }
  153. }
  154. }
  155. }); // eslint-disable-next-line no-unused-vars
  156. var cardChart4 = new Chart($('#card-chart4'), {
  157. type: 'bar',
  158. data: {
  159. labels: ['January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December', 'January', 'February', 'March', 'April'],
  160. datasets: [{
  161. label: 'My First dataset',
  162. backgroundColor: 'rgba(255,255,255,.2)',
  163. borderColor: 'rgba(255,255,255,.55)',
  164. data: [78, 81, 80, 45, 34, 12, 40, 85, 65, 23, 12, 98, 34, 84, 67, 82]
  165. }]
  166. },
  167. options: {
  168. maintainAspectRatio: false,
  169. legend: {
  170. display: false
  171. },
  172. scales: {
  173. xAxes: [{
  174. display: false,
  175. barPercentage: 0.6
  176. }],
  177. yAxes: [{
  178. display: false
  179. }]
  180. }
  181. }
  182. }); // eslint-disable-next-line no-unused-vars
  183. var mainChart = new Chart($('#main-chart'), {
  184. type: 'line',
  185. data: {
  186. labels: ['M', 'T', 'W', 'T', 'F', 'S', 'S', 'M', 'T', 'W', 'T', 'F', 'S', 'S', 'M', 'T', 'W', 'T', 'F', 'S', 'S', 'M', 'T', 'W', 'T', 'F', 'S', 'S'],
  187. datasets: [{
  188. label: 'My First dataset',
  189. backgroundColor: hexToRgba(getStyle('--info'), 10),
  190. borderColor: getStyle('--info'),
  191. pointHoverBackgroundColor: '#fff',
  192. borderWidth: 2,
  193. data: [165, 180, 70, 69, 77, 57, 125, 165, 172, 91, 173, 138, 155, 89, 50, 161, 65, 163, 160, 103, 114, 185, 125, 196, 183, 64, 137, 95, 112, 175]
  194. }, {
  195. label: 'My Second dataset',
  196. backgroundColor: 'transparent',
  197. borderColor: getStyle('--success'),
  198. pointHoverBackgroundColor: '#fff',
  199. borderWidth: 2,
  200. data: [92, 97, 80, 100, 86, 97, 83, 98, 87, 98, 93, 83, 87, 98, 96, 84, 91, 97, 88, 86, 94, 86, 95, 91, 98, 91, 92, 80, 83, 82]
  201. }, {
  202. label: 'My Third dataset',
  203. backgroundColor: 'transparent',
  204. borderColor: getStyle('--danger'),
  205. pointHoverBackgroundColor: '#fff',
  206. borderWidth: 1,
  207. borderDash: [8, 5],
  208. data: [65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65]
  209. }]
  210. },
  211. options: {
  212. maintainAspectRatio: false,
  213. legend: {
  214. display: false
  215. },
  216. scales: {
  217. xAxes: [{
  218. gridLines: {
  219. drawOnChartArea: false
  220. }
  221. }],
  222. yAxes: [{
  223. ticks: {
  224. beginAtZero: true,
  225. maxTicksLimit: 5,
  226. stepSize: Math.ceil(250 / 5),
  227. max: 250
  228. }
  229. }]
  230. },
  231. elements: {
  232. point: {
  233. radius: 0,
  234. hitRadius: 10,
  235. hoverRadius: 4,
  236. hoverBorderWidth: 3
  237. }
  238. }
  239. }
  240. });
  241. var brandBoxChartLabels = ['January', 'February', 'March', 'April', 'May', 'June', 'July'];
  242. var brandBoxChartOptions = {
  243. responsive: true,
  244. maintainAspectRatio: false,
  245. legend: {
  246. display: false
  247. },
  248. scales: {
  249. xAxes: [{
  250. display: false
  251. }],
  252. yAxes: [{
  253. display: false
  254. }]
  255. },
  256. elements: {
  257. point: {
  258. radius: 0,
  259. hitRadius: 10,
  260. hoverRadius: 4,
  261. hoverBorderWidth: 3
  262. }
  263. } // eslint-disable-next-line no-unused-vars
  264. };
  265. var brandBoxChart1 = new Chart($('#social-box-chart-1'), {
  266. type: 'line',
  267. data: {
  268. labels: brandBoxChartLabels,
  269. datasets: [{
  270. label: 'My First dataset',
  271. backgroundColor: 'rgba(255,255,255,.1)',
  272. borderColor: 'rgba(255,255,255,.55)',
  273. pointHoverBackgroundColor: '#fff',
  274. borderWidth: 2,
  275. data: [65, 59, 84, 84, 51, 55, 40]
  276. }]
  277. },
  278. options: brandBoxChartOptions
  279. }); // eslint-disable-next-line no-unused-vars
  280. var brandBoxChart2 = new Chart($('#social-box-chart-2'), {
  281. type: 'line',
  282. data: {
  283. labels: brandBoxChartLabels,
  284. datasets: [{
  285. label: 'My First dataset',
  286. backgroundColor: 'rgba(255,255,255,.1)',
  287. borderColor: 'rgba(255,255,255,.55)',
  288. pointHoverBackgroundColor: '#fff',
  289. borderWidth: 2,
  290. data: [1, 13, 9, 17, 34, 41, 38]
  291. }]
  292. },
  293. options: brandBoxChartOptions
  294. }); // eslint-disable-next-line no-unused-vars
  295. var brandBoxChart3 = new Chart($('#social-box-chart-3'), {
  296. type: 'line',
  297. data: {
  298. labels: brandBoxChartLabels,
  299. datasets: [{
  300. label: 'My First dataset',
  301. backgroundColor: 'rgba(255,255,255,.1)',
  302. borderColor: 'rgba(255,255,255,.55)',
  303. pointHoverBackgroundColor: '#fff',
  304. borderWidth: 2,
  305. data: [78, 81, 80, 45, 34, 12, 40]
  306. }]
  307. },
  308. options: brandBoxChartOptions
  309. }); // eslint-disable-next-line no-unused-vars
  310. var brandBoxChart4 = new Chart($('#social-box-chart-4'), {
  311. type: 'line',
  312. data: {
  313. labels: brandBoxChartLabels,
  314. datasets: [{
  315. label: 'My First dataset',
  316. backgroundColor: 'rgba(255,255,255,.1)',
  317. borderColor: 'rgba(255,255,255,.55)',
  318. pointHoverBackgroundColor: '#fff',
  319. borderWidth: 2,
  320. data: [35, 23, 56, 22, 97, 23, 64]
  321. }]
  322. },
  323. options: brandBoxChartOptions
  324. });
  325. //# sourceMappingURL=main.js.map