widgets.js 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449
  1. "use strict";
  2. /* global Chart, CustomTooltips, getStyle */
  3. /**
  4. * --------------------------------------------------------------------------
  5. * CoreUI Free Boostrap Admin Template (v2.1.15): main.js
  6. * Licensed under MIT (https://coreui.io/license)
  7. * --------------------------------------------------------------------------
  8. */
  9. /* eslint-disable no-magic-numbers */
  10. // Disable the on-canvas tooltip
  11. Chart.defaults.global.pointHitDetectionRadius = 1;
  12. Chart.defaults.global.tooltips.enabled = false;
  13. Chart.defaults.global.tooltips.mode = 'index';
  14. Chart.defaults.global.tooltips.position = 'nearest';
  15. Chart.defaults.global.tooltips.custom = CustomTooltips; // eslint-disable-next-line no-unused-vars
  16. var cardChart1 = new Chart($('#card-chart1'), {
  17. type: 'line',
  18. data: {
  19. labels: ['January', 'February', 'March', 'April', 'May', 'June', 'July'],
  20. datasets: [{
  21. label: 'My First dataset',
  22. backgroundColor: getStyle('--primary'),
  23. borderColor: 'rgba(255,255,255,.55)',
  24. data: [65, 59, 84, 84, 51, 55, 40]
  25. }]
  26. },
  27. options: {
  28. maintainAspectRatio: false,
  29. legend: {
  30. display: false
  31. },
  32. scales: {
  33. xAxes: [{
  34. gridLines: {
  35. color: 'transparent',
  36. zeroLineColor: 'transparent'
  37. },
  38. ticks: {
  39. fontSize: 2,
  40. fontColor: 'transparent'
  41. }
  42. }],
  43. yAxes: [{
  44. display: false,
  45. ticks: {
  46. display: false,
  47. min: 35,
  48. max: 89
  49. }
  50. }]
  51. },
  52. elements: {
  53. line: {
  54. borderWidth: 1
  55. },
  56. point: {
  57. radius: 4,
  58. hitRadius: 10,
  59. hoverRadius: 4
  60. }
  61. }
  62. }
  63. }); // eslint-disable-next-line no-unused-vars
  64. var cardChart2 = new Chart($('#card-chart2'), {
  65. type: 'line',
  66. data: {
  67. labels: ['January', 'February', 'March', 'April', 'May', 'June', 'July'],
  68. datasets: [{
  69. label: 'My First dataset',
  70. backgroundColor: getStyle('--info'),
  71. borderColor: 'rgba(255,255,255,.55)',
  72. data: [1, 18, 9, 17, 34, 22, 11]
  73. }]
  74. },
  75. options: {
  76. maintainAspectRatio: false,
  77. legend: {
  78. display: false
  79. },
  80. scales: {
  81. xAxes: [{
  82. gridLines: {
  83. color: 'transparent',
  84. zeroLineColor: 'transparent'
  85. },
  86. ticks: {
  87. fontSize: 2,
  88. fontColor: 'transparent'
  89. }
  90. }],
  91. yAxes: [{
  92. display: false,
  93. ticks: {
  94. display: false,
  95. min: -4,
  96. max: 39
  97. }
  98. }]
  99. },
  100. elements: {
  101. line: {
  102. tension: 0.00001,
  103. borderWidth: 1
  104. },
  105. point: {
  106. radius: 4,
  107. hitRadius: 10,
  108. hoverRadius: 4
  109. }
  110. }
  111. }
  112. }); // eslint-disable-next-line no-unused-vars
  113. var cardChart3 = new Chart($('#card-chart3'), {
  114. type: 'line',
  115. data: {
  116. labels: ['January', 'February', 'March', 'April', 'May', 'June', 'July'],
  117. datasets: [{
  118. label: 'My First dataset',
  119. backgroundColor: 'rgba(255,255,255,.2)',
  120. borderColor: 'rgba(255,255,255,.55)',
  121. data: [78, 81, 80, 45, 34, 12, 40]
  122. }]
  123. },
  124. options: {
  125. maintainAspectRatio: false,
  126. legend: {
  127. display: false
  128. },
  129. scales: {
  130. xAxes: [{
  131. display: false
  132. }],
  133. yAxes: [{
  134. display: false
  135. }]
  136. },
  137. elements: {
  138. line: {
  139. borderWidth: 2
  140. },
  141. point: {
  142. radius: 0,
  143. hitRadius: 10,
  144. hoverRadius: 4
  145. }
  146. }
  147. }
  148. }); // eslint-disable-next-line no-unused-vars
  149. var cardChart4 = new Chart($('#card-chart4'), {
  150. type: 'bar',
  151. data: {
  152. labels: ['January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December', 'January', 'February', 'March', 'April'],
  153. datasets: [{
  154. label: 'My First dataset',
  155. backgroundColor: 'rgba(255,255,255,.2)',
  156. borderColor: 'rgba(255,255,255,.55)',
  157. data: [78, 81, 80, 45, 34, 12, 40, 85, 65, 23, 12, 98, 34, 84, 67, 82]
  158. }]
  159. },
  160. options: {
  161. maintainAspectRatio: false,
  162. legend: {
  163. display: false
  164. },
  165. scales: {
  166. xAxes: [{
  167. display: false,
  168. barPercentage: 0.6
  169. }],
  170. yAxes: [{
  171. display: false
  172. }]
  173. }
  174. }
  175. }); // Random Numbers
  176. var random = function random(min, max) {
  177. return Math.floor(Math.random() * (max - min + 1) + min);
  178. }; // eslint-disable-next-line no-unused-vars
  179. var sparklineChart1 = new Chart($('#sparkline-chart-1'), {
  180. type: 'bar',
  181. data: {
  182. labels: ['M', 'T', 'W', 'T', 'F', 'S', 'S', 'M', 'T', 'W', 'T', 'F', 'S', 'S', 'M'],
  183. datasets: [{
  184. backgroundColor: getStyle('--primary'),
  185. borderColor: 'transparent',
  186. borderWidth: 1,
  187. data: [random(40, 100), random(40, 100), random(40, 100), random(40, 100), random(40, 100), random(40, 100), random(40, 100), random(40, 100), random(40, 100), random(40, 100), random(40, 100), random(40, 100), random(40, 100), random(40, 100), random(40, 100)]
  188. }]
  189. },
  190. options: {
  191. maintainAspectRatio: false,
  192. legend: {
  193. display: false
  194. },
  195. scales: {
  196. xAxes: [{
  197. display: false
  198. }],
  199. yAxes: [{
  200. display: false
  201. }]
  202. }
  203. }
  204. }); // eslint-disable-next-line no-unused-vars
  205. var sparklineChart2 = new Chart($('#sparkline-chart-2'), {
  206. type: 'bar',
  207. data: {
  208. labels: ['M', 'T', 'W', 'T', 'F', 'S', 'S', 'M', 'T', 'W', 'T', 'F', 'S', 'S', 'M'],
  209. datasets: [{
  210. backgroundColor: getStyle('--warning'),
  211. borderColor: 'transparent',
  212. borderWidth: 1,
  213. data: [random(40, 100), random(40, 100), random(40, 100), random(40, 100), random(40, 100), random(40, 100), random(40, 100), random(40, 100), random(40, 100), random(40, 100), random(40, 100), random(40, 100), random(40, 100), random(40, 100), random(40, 100)]
  214. }]
  215. },
  216. options: {
  217. maintainAspectRatio: false,
  218. legend: {
  219. display: false
  220. },
  221. scales: {
  222. xAxes: [{
  223. display: false
  224. }],
  225. yAxes: [{
  226. display: false
  227. }]
  228. }
  229. }
  230. }); // eslint-disable-next-line no-unused-vars
  231. var sparklineChart3 = new Chart($('#sparkline-chart-3'), {
  232. type: 'bar',
  233. data: {
  234. labels: ['M', 'T', 'W', 'T', 'F', 'S', 'S', 'M', 'T', 'W', 'T', 'F', 'S', 'S', 'M'],
  235. datasets: [{
  236. backgroundColor: getStyle('--success'),
  237. borderColor: 'transparent',
  238. borderWidth: 1,
  239. data: [random(40, 100), random(40, 100), random(40, 100), random(40, 100), random(40, 100), random(40, 100), random(40, 100), random(40, 100), random(40, 100), random(40, 100), random(40, 100), random(40, 100), random(40, 100), random(40, 100), random(40, 100)]
  240. }]
  241. },
  242. options: {
  243. maintainAspectRatio: false,
  244. legend: {
  245. display: false
  246. },
  247. scales: {
  248. xAxes: [{
  249. display: false
  250. }],
  251. yAxes: [{
  252. display: false
  253. }]
  254. }
  255. }
  256. }); // eslint-disable-next-line no-unused-vars
  257. var sparklineChart4 = new Chart($('#sparkline-chart-4'), {
  258. type: 'line',
  259. data: {
  260. labels: ['M', 'T', 'W', 'T', 'F', 'S', 'S'],
  261. datasets: [{
  262. backgroundColor: 'transparent',
  263. borderColor: getStyle('--info'),
  264. borderWidth: 2,
  265. data: [random(40, 100), random(40, 100), random(40, 100), random(40, 100), random(40, 100), random(40, 100), random(40, 100)]
  266. }]
  267. },
  268. options: {
  269. maintainAspectRatio: false,
  270. legend: {
  271. display: false
  272. },
  273. scales: {
  274. xAxes: [{
  275. display: false
  276. }],
  277. yAxes: [{
  278. display: false
  279. }]
  280. },
  281. elements: {
  282. point: {
  283. radius: 0
  284. }
  285. }
  286. }
  287. }); // eslint-disable-next-line no-unused-vars
  288. var sparklineChart5 = new Chart($('#sparkline-chart-5'), {
  289. type: 'line',
  290. data: {
  291. labels: ['M', 'T', 'W', 'T', 'F', 'S', 'S'],
  292. datasets: [{
  293. backgroundColor: 'transparent',
  294. borderColor: getStyle('--success'),
  295. borderWidth: 2,
  296. data: [random(40, 100), random(40, 100), random(40, 100), random(40, 100), random(40, 100), random(40, 100), random(40, 100)]
  297. }]
  298. },
  299. options: {
  300. maintainAspectRatio: false,
  301. legend: {
  302. display: false
  303. },
  304. scales: {
  305. xAxes: [{
  306. display: false
  307. }],
  308. yAxes: [{
  309. display: false
  310. }]
  311. },
  312. elements: {
  313. point: {
  314. radius: 0
  315. }
  316. }
  317. }
  318. }); // eslint-disable-next-line no-unused-vars
  319. var sparklineChart6 = new Chart($('#sparkline-chart-6'), {
  320. type: 'line',
  321. data: {
  322. labels: ['M', 'T', 'W', 'T', 'F', 'S', 'S'],
  323. datasets: [{
  324. backgroundColor: 'transparent',
  325. borderColor: getStyle('--danger'),
  326. borderWidth: 2,
  327. data: [random(40, 100), random(40, 100), random(40, 100), random(40, 100), random(40, 100), random(40, 100), random(40, 100)]
  328. }]
  329. },
  330. options: {
  331. maintainAspectRatio: false,
  332. legend: {
  333. display: false
  334. },
  335. scales: {
  336. xAxes: [{
  337. display: false
  338. }],
  339. yAxes: [{
  340. display: false
  341. }]
  342. },
  343. elements: {
  344. point: {
  345. radius: 0
  346. }
  347. }
  348. }
  349. });
  350. var brandBoxChartLabels = ['January', 'February', 'March', 'April', 'May', 'June', 'July'];
  351. var brandBoxChartOptions = {
  352. responsive: true,
  353. maintainAspectRatio: false,
  354. legend: {
  355. display: false
  356. },
  357. scales: {
  358. xAxes: [{
  359. display: false
  360. }],
  361. yAxes: [{
  362. display: false
  363. }]
  364. },
  365. elements: {
  366. point: {
  367. radius: 0,
  368. hitRadius: 10,
  369. hoverRadius: 4,
  370. hoverBorderWidth: 3
  371. }
  372. } // eslint-disable-next-line no-unused-vars
  373. };
  374. var brandBoxChart1 = new Chart($('#social-box-chart-1'), {
  375. type: 'line',
  376. data: {
  377. labels: brandBoxChartLabels,
  378. datasets: [{
  379. backgroundColor: 'rgba(255,255,255,.1)',
  380. borderColor: 'rgba(255,255,255,.55)',
  381. pointHoverBackgroundColor: '#fff',
  382. borderWidth: 2,
  383. data: [65, 59, 84, 84, 51, 55, 40]
  384. }]
  385. },
  386. options: brandBoxChartOptions
  387. }); // eslint-disable-next-line no-unused-vars
  388. var brandBoxChart2 = new Chart($('#social-box-chart-2'), {
  389. type: 'line',
  390. data: {
  391. labels: brandBoxChartLabels,
  392. datasets: [{
  393. backgroundColor: 'rgba(255,255,255,.1)',
  394. borderColor: 'rgba(255,255,255,.55)',
  395. pointHoverBackgroundColor: '#fff',
  396. borderWidth: 2,
  397. data: [1, 13, 9, 17, 34, 41, 38]
  398. }]
  399. },
  400. options: brandBoxChartOptions
  401. }); // eslint-disable-next-line no-unused-vars
  402. var brandBoxChart3 = new Chart($('#social-box-chart-3'), {
  403. type: 'line',
  404. data: {
  405. labels: brandBoxChartLabels,
  406. datasets: [{
  407. backgroundColor: 'rgba(255,255,255,.1)',
  408. borderColor: 'rgba(255,255,255,.55)',
  409. pointHoverBackgroundColor: '#fff',
  410. borderWidth: 2,
  411. data: [78, 81, 80, 45, 34, 12, 40]
  412. }]
  413. },
  414. options: brandBoxChartOptions
  415. }); // eslint-disable-next-line no-unused-vars
  416. var brandBoxChart4 = new Chart($('#social-box-chart-4'), {
  417. type: 'line',
  418. data: {
  419. labels: brandBoxChartLabels,
  420. datasets: [{
  421. backgroundColor: 'rgba(255,255,255,.1)',
  422. borderColor: 'rgba(255,255,255,.55)',
  423. pointHoverBackgroundColor: '#fff',
  424. borderWidth: 2,
  425. data: [35, 23, 56, 22, 97, 23, 64]
  426. }]
  427. },
  428. options: brandBoxChartOptions
  429. });
  430. //# sourceMappingURL=widgets.js.map