dashboard-ecommerce.js 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635
  1. /*=========================================================================================
  2. File Name: dashboard-ecommerce.js
  3. Description: dashboard ecommerce page content with Apexchart Examples
  4. ----------------------------------------------------------------------------------------
  5. Item name: Vuexy - Vuejs, HTML & Laravel Admin Dashboard Template
  6. Author: PIXINVENT
  7. Author URL: http://www.themeforest.net/user/pixinvent
  8. ==========================================================================================*/
  9. $(window).on("load", function () {
  10. var $primary = '#7367F0';
  11. var $success = '#28C76F';
  12. var $danger = '#EA5455';
  13. var $warning = '#FF9F43';
  14. var $info = '#00cfe8';
  15. var $primary_light = '#A9A2F6';
  16. var $danger_light = '#f29292';
  17. var $success_light = '#55DD92';
  18. var $warning_light = '#ffc085';
  19. var $info_light = '#1fcadb';
  20. var $strok_color = '#b9c3cd';
  21. var $label_color = '#e7e7e7';
  22. var $white = '#fff';
  23. // Line Area Chart - 1
  24. // ----------------------------------
  25. var gainedlineChartoptions = {
  26. chart: {
  27. height: 100,
  28. type: 'area',
  29. toolbar: {
  30. show: false,
  31. },
  32. sparkline: {
  33. enabled: true
  34. },
  35. grid: {
  36. show: false,
  37. padding: {
  38. left: 0,
  39. right: 0
  40. }
  41. },
  42. },
  43. colors: [$primary],
  44. dataLabels: {
  45. enabled: false
  46. },
  47. stroke: {
  48. curve: 'smooth',
  49. width: 2.5
  50. },
  51. fill: {
  52. type: 'gradient',
  53. gradient: {
  54. shadeIntensity: 0.9,
  55. opacityFrom: 0.7,
  56. opacityTo: 0.5,
  57. stops: [0, 80, 100]
  58. }
  59. },
  60. series: [{
  61. name: 'Subscribers',
  62. data: [28, 40, 36, 52, 38, 60, 55]
  63. }],
  64. xaxis: {
  65. labels: {
  66. show: false,
  67. },
  68. axisBorder: {
  69. show: false,
  70. }
  71. },
  72. yaxis: [{
  73. y: 0,
  74. offsetX: 0,
  75. offsetY: 0,
  76. padding: { left: 0, right: 0 },
  77. }],
  78. tooltip: {
  79. x: { show: false }
  80. },
  81. }
  82. var gainedlineChart = new ApexCharts(
  83. document.querySelector("#line-area-chart-1"),
  84. gainedlineChartoptions
  85. );
  86. gainedlineChart.render();
  87. // Line Area Chart - 2
  88. // ----------------------------------
  89. var revenuelineChartoptions = {
  90. chart: {
  91. height: 100,
  92. type: 'area',
  93. toolbar: {
  94. show: false,
  95. },
  96. sparkline: {
  97. enabled: true
  98. },
  99. grid: {
  100. show: false,
  101. padding: {
  102. left: 0,
  103. right: 0
  104. }
  105. },
  106. },
  107. colors: [$success],
  108. dataLabels: {
  109. enabled: false
  110. },
  111. stroke: {
  112. curve: 'smooth',
  113. width: 2.5
  114. },
  115. fill: {
  116. type: 'gradient',
  117. gradient: {
  118. shadeIntensity: 0.9,
  119. opacityFrom: 0.7,
  120. opacityTo: 0.5,
  121. stops: [0, 80, 100]
  122. }
  123. },
  124. series: [{
  125. name: 'Revenue',
  126. data: [350, 275, 400, 300, 350, 300, 450]
  127. }],
  128. xaxis: {
  129. labels: {
  130. show: false,
  131. },
  132. axisBorder: {
  133. show: false,
  134. }
  135. },
  136. yaxis: [{
  137. y: 0,
  138. offsetX: 0,
  139. offsetY: 0,
  140. padding: { left: 0, right: 0 },
  141. }],
  142. tooltip: {
  143. x: { show: false }
  144. },
  145. }
  146. var revenuelineChart = new ApexCharts(
  147. document.querySelector("#line-area-chart-2"),
  148. revenuelineChartoptions
  149. );
  150. revenuelineChart.render();
  151. // Line Area Chart - 3
  152. // ----------------------------------
  153. var saleslineChartoptions = {
  154. chart: {
  155. height: 100,
  156. type: 'area',
  157. toolbar: {
  158. show: false,
  159. },
  160. sparkline: {
  161. enabled: true
  162. },
  163. grid: {
  164. show: false,
  165. padding: {
  166. left: 0,
  167. right: 0
  168. }
  169. },
  170. },
  171. colors: [$danger],
  172. dataLabels: {
  173. enabled: false
  174. },
  175. stroke: {
  176. curve: 'smooth',
  177. width: 2.5
  178. },
  179. fill: {
  180. type: 'gradient',
  181. gradient: {
  182. shadeIntensity: 0.9,
  183. opacityFrom: 0.7,
  184. opacityTo: 0.5,
  185. stops: [0, 80, 100]
  186. }
  187. },
  188. series: [{
  189. name: 'Sales',
  190. data: [10, 15, 7, 12, 3, 16]
  191. }],
  192. xaxis: {
  193. labels: {
  194. show: false,
  195. },
  196. axisBorder: {
  197. show: false,
  198. }
  199. },
  200. yaxis: [{
  201. y: 0,
  202. offsetX: 0,
  203. offsetY: 0,
  204. padding: { left: 0, right: 0 },
  205. }],
  206. tooltip: {
  207. x: { show: false }
  208. },
  209. }
  210. var saleslineChart = new ApexCharts(
  211. document.querySelector("#line-area-chart-3"),
  212. saleslineChartoptions
  213. );
  214. saleslineChart.render();
  215. // Line Area Chart - 4
  216. // ----------------------------------
  217. var orderlineChartoptions = {
  218. chart: {
  219. height: 100,
  220. type: 'area',
  221. toolbar: {
  222. show: false,
  223. },
  224. sparkline: {
  225. enabled: true
  226. },
  227. grid: {
  228. show: false,
  229. padding: {
  230. left: 0,
  231. right: 0
  232. }
  233. },
  234. },
  235. colors: [$warning],
  236. dataLabels: {
  237. enabled: false
  238. },
  239. stroke: {
  240. curve: 'smooth',
  241. width: 2.5
  242. },
  243. fill: {
  244. type: 'gradient',
  245. gradient: {
  246. shadeIntensity: 0.9,
  247. opacityFrom: 0.7,
  248. opacityTo: 0.5,
  249. stops: [0, 80, 100]
  250. }
  251. },
  252. series: [{
  253. name: 'Orders',
  254. data: [10, 15, 8, 15, 7, 12, 8]
  255. }],
  256. xaxis: {
  257. labels: {
  258. show: false,
  259. },
  260. axisBorder: {
  261. show: false,
  262. }
  263. },
  264. yaxis: [{
  265. y: 0,
  266. offsetX: 0,
  267. offsetY: 0,
  268. padding: { left: 0, right: 0 },
  269. }],
  270. tooltip: {
  271. x: { show: false }
  272. },
  273. }
  274. var orderlineChart = new ApexCharts(
  275. document.querySelector("#line-area-chart-4"),
  276. orderlineChartoptions
  277. );
  278. orderlineChart.render();
  279. // revenue-chart Chart
  280. // -----------------------------
  281. var revenueChartoptions = {
  282. chart: {
  283. height: 270,
  284. toolbar: { show: false },
  285. type: 'line',
  286. },
  287. stroke: {
  288. curve: 'smooth',
  289. dashArray: [0, 8],
  290. width: [4, 2],
  291. },
  292. grid: {
  293. borderColor: $label_color,
  294. },
  295. legend: {
  296. show: false,
  297. },
  298. colors: [$danger_light, $strok_color],
  299. fill: {
  300. type: 'gradient',
  301. gradient: {
  302. shade: 'dark',
  303. inverseColors: false,
  304. gradientToColors: [$primary, $strok_color],
  305. shadeIntensity: 1,
  306. type: 'horizontal',
  307. opacityFrom: 1,
  308. opacityTo: 1,
  309. stops: [0, 100, 100, 100]
  310. },
  311. },
  312. markers: {
  313. size: 0,
  314. hover: {
  315. size: 5
  316. }
  317. },
  318. xaxis: {
  319. labels: {
  320. style: {
  321. colors: $strok_color,
  322. }
  323. },
  324. axisTicks: {
  325. show: false,
  326. },
  327. categories: ['01', '05', '09', '13', '17', '21', '26', '31'],
  328. axisBorder: {
  329. show: false,
  330. },
  331. tickPlacement: 'on',
  332. },
  333. yaxis: {
  334. tickAmount: 5,
  335. labels: {
  336. style: {
  337. color: $strok_color,
  338. },
  339. formatter: function (val) {
  340. return val > 999 ? (val / 1000).toFixed(1) + 'k' : val;
  341. }
  342. }
  343. },
  344. tooltip: {
  345. x: { show: false }
  346. },
  347. series: [{
  348. name: "This Month",
  349. data: [45000, 47000, 44800, 47500, 45500, 48000, 46500, 48600]
  350. },
  351. {
  352. name: "Last Month",
  353. data: [46000, 48000, 45500, 46600, 44500, 46500, 45000, 47000]
  354. }
  355. ],
  356. }
  357. var revenueChart = new ApexCharts(
  358. document.querySelector("#revenue-chart"),
  359. revenueChartoptions
  360. );
  361. revenueChart.render();
  362. // Goal Overview Chart
  363. // -----------------------------
  364. var goalChartoptions = {
  365. chart: {
  366. height: 250,
  367. type: 'radialBar',
  368. sparkline: {
  369. enabled: true,
  370. },
  371. dropShadow: {
  372. enabled: true,
  373. blur: 3,
  374. left: 1,
  375. top: 1,
  376. opacity: 0.1
  377. },
  378. },
  379. colors: [$success],
  380. plotOptions: {
  381. radialBar: {
  382. size: 110,
  383. startAngle: -150,
  384. endAngle: 150,
  385. hollow: {
  386. size: '77%',
  387. },
  388. track: {
  389. background: $strok_color,
  390. strokeWidth: '50%',
  391. },
  392. dataLabels: {
  393. name: {
  394. show: false
  395. },
  396. value: {
  397. offsetY: 18,
  398. color: '#99a2ac',
  399. fontSize: '4rem'
  400. }
  401. }
  402. }
  403. },
  404. fill: {
  405. type: 'gradient',
  406. gradient: {
  407. shade: 'dark',
  408. type: 'horizontal',
  409. shadeIntensity: 0.5,
  410. gradientToColors: ['#00b5b5'],
  411. inverseColors: true,
  412. opacityFrom: 1,
  413. opacityTo: 1,
  414. stops: [0, 100]
  415. },
  416. },
  417. series: [83],
  418. stroke: {
  419. lineCap: 'round'
  420. },
  421. }
  422. var goalChart = new ApexCharts(
  423. document.querySelector("#goal-overview-chart"),
  424. goalChartoptions
  425. );
  426. goalChart.render();
  427. // Client Retention Chart
  428. // ----------------------------------
  429. var clientChartoptions = {
  430. chart: {
  431. stacked: true,
  432. type: 'bar',
  433. toolbar: { show: false },
  434. height: 300,
  435. },
  436. plotOptions: {
  437. bar: {
  438. columnWidth: '10%'
  439. }
  440. },
  441. colors: [$primary, $danger],
  442. series: [{
  443. name: 'New Clients',
  444. data: [175, 125, 225, 175, 160, 189, 206, 134, 159, 216, 148, 123]
  445. }, {
  446. name: 'Retained Clients',
  447. data: [-144, -155, -141, -167, -122, -143, -158, -107, -126, -131, -140, -137]
  448. }],
  449. grid: {
  450. borderColor: $label_color,
  451. padding: {
  452. left: 0,
  453. right: 0
  454. }
  455. },
  456. legend: {
  457. show: true,
  458. position: 'top',
  459. horizontalAlign: 'left',
  460. offsetX: 0,
  461. fontSize: '14px',
  462. markers: {
  463. radius: 50,
  464. width: 10,
  465. height: 10,
  466. }
  467. },
  468. dataLabels: {
  469. enabled: false
  470. },
  471. xaxis: {
  472. labels: {
  473. style: {
  474. colors: $strok_color,
  475. }
  476. },
  477. axisTicks: {
  478. show: false,
  479. },
  480. categories: ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'],
  481. axisBorder: {
  482. show: false,
  483. },
  484. },
  485. yaxis: {
  486. tickAmount: 5,
  487. labels: {
  488. style: {
  489. color: $strok_color,
  490. }
  491. }
  492. },
  493. tooltip: {
  494. x: { show: false }
  495. },
  496. }
  497. var clientChart = new ApexCharts(
  498. document.querySelector("#client-retention-chart"),
  499. clientChartoptions
  500. );
  501. clientChart.render();
  502. // Session Chart
  503. // ----------------------------------
  504. var sessionChartoptions = {
  505. chart: {
  506. type: 'donut',
  507. height: 325,
  508. toolbar: {
  509. show: false
  510. }
  511. },
  512. dataLabels: {
  513. enabled: false
  514. },
  515. series: [58.6, 34.9, 6.5],
  516. legend: { show: false },
  517. comparedResult: [2, -3, 8],
  518. labels: ['Desktop', 'Mobile', 'Tablet'],
  519. stroke: { width: 0 },
  520. colors: [$primary, $warning, $danger],
  521. fill: {
  522. type: 'gradient',
  523. gradient: {
  524. gradientToColors: [$primary_light, $warning_light, $danger_light]
  525. }
  526. }
  527. }
  528. var sessionChart = new ApexCharts(
  529. document.querySelector("#session-chart"),
  530. sessionChartoptions
  531. );
  532. sessionChart.render();
  533. // Customer Chart
  534. // -----------------------------
  535. var customerChartoptions = {
  536. chart: {
  537. type: 'pie',
  538. height: 330,
  539. dropShadow: {
  540. enabled: false,
  541. blur: 5,
  542. left: 1,
  543. top: 1,
  544. opacity: 0.2
  545. },
  546. toolbar: {
  547. show: false
  548. }
  549. },
  550. labels: ['New', 'Returning', 'Referrals'],
  551. series: [690, 258, 149],
  552. dataLabels: {
  553. enabled: false
  554. },
  555. legend: { show: false },
  556. stroke: {
  557. width: 5
  558. },
  559. colors: [$primary, $warning, $danger],
  560. fill: {
  561. type: 'gradient',
  562. gradient: {
  563. gradientToColors: [$primary_light, $warning_light, $danger_light]
  564. }
  565. }
  566. }
  567. var customerChart = new ApexCharts(
  568. document.querySelector("#customer-chart"),
  569. customerChartoptions
  570. );
  571. customerChart.render();
  572. });
  573. // Chat Application
  574. (function ($) {
  575. "use strict";
  576. // Chat area
  577. if ($('.chat-application .user-chats').length > 0) {
  578. var chat_user = new PerfectScrollbar(".user-chats", { wheelPropagation: false });
  579. }
  580. })(jQuery);