crypto-wallet.init.js 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596
  1. /******/ (function() { // webpackBootstrap
  2. var __webpack_exports__ = {};
  3. /*!**************************************************!*\
  4. !*** ./resources/js/pages/crypto-wallet.init.js ***!
  5. \**************************************************/
  6. /*
  7. Template Name: Skote - Admin & Dashboard Template
  8. Author: Themesbrand
  9. Website: https://themesbrand.com/
  10. Contact: themesbrand@gmail.com
  11. File: Crypto wallet Init Js File
  12. */
  13. // get colors array from the string
  14. function getChartColorsArray(chartId) {
  15. if (document.getElementById(chartId) !== null) {
  16. var colors = document.getElementById(chartId).getAttribute("data-colors");
  17. if (colors) {
  18. colors = JSON.parse(colors);
  19. return colors.map(function (value) {
  20. var newValue = value.replace(" ", "");
  21. if (newValue.indexOf(",") === -1) {
  22. var color = getComputedStyle(document.documentElement).getPropertyValue(newValue);
  23. if (color){
  24. color = color.replace(" ", "");
  25. return color;
  26. }
  27. else return newValue;;
  28. } else {
  29. var val = value.split(',');
  30. if (val.length == 2) {
  31. var rgbaColor = getComputedStyle(document.documentElement).getPropertyValue(val[0]);
  32. rgbaColor = "rgba(" + rgbaColor + "," + val[1] + ")";
  33. return rgbaColor;
  34. } else {
  35. return newValue;
  36. }
  37. }
  38. });
  39. }
  40. }
  41. } // overview-chart
  42. var overviewChartColors = getChartColorsArray("overview-chart");
  43. if (overviewChartColors) {
  44. var options = {
  45. series: [{
  46. type: 'area',
  47. name: 'BTC',
  48. data: [87, 57, 74, 99, 75, 38, 62, 47, 82, 56, 45, 47]
  49. }, {
  50. type: 'area',
  51. name: 'ETH',
  52. data: [28, 41, 52, 42, 13, 18, 29, 18, 36, 51, 55, 35]
  53. }, {
  54. type: 'line',
  55. name: 'LTC',
  56. data: [45, 52, 38, 24, 33, 65, 45, 75, 54, 18, 28, 10]
  57. }],
  58. chart: {
  59. height: 240,
  60. type: 'line',
  61. toolbar: {
  62. show: false
  63. }
  64. },
  65. dataLabels: {
  66. enabled: false
  67. },
  68. stroke: {
  69. curve: 'smooth',
  70. width: 2,
  71. dashArray: [0, 0, 3]
  72. },
  73. fill: {
  74. type: 'solid',
  75. opacity: [0.15, 0.05, 1]
  76. },
  77. xaxis: {
  78. categories: ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec']
  79. },
  80. colors: overviewChartColors
  81. };
  82. var chartOverview = new ApexCharts(document.querySelector("#overview-chart"), options);
  83. chartOverview.render(); // datatable
  84. $(document).ready(function () {
  85. $('#datatable').DataTable();
  86. $(".dataTables_length select").addClass('form-select form-select-sm');
  87. });
  88. }
  89. /******/ })()
  90. ;