card-analytics.js 17 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693
  1. /*=========================================================================================
  2. File Name: card-statistics.js
  3. Description: Card-statistics 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 $danger = '#EA5455';
  12. var $warning = '#FF9F43';
  13. var $info = '#00cfe8';
  14. var $success = '#00db89';
  15. var $primary_light = '#9c8cfc';
  16. var $warning_light = '#FFC085';
  17. var $danger_light = '#f29292';
  18. var $info_light = '#1edec5';
  19. var $strok_color = '#b9c3cd';
  20. var $label_color = '#e7eef7';
  21. var $purple = '#df87f2';
  22. var $white = '#fff';
  23. // Session Chart
  24. // ----------------------------------
  25. var sessionChartoptions = {
  26. chart: {
  27. type: 'donut',
  28. height: 315,
  29. toolbar: {
  30. show: false
  31. }
  32. },
  33. dataLabels: {
  34. enabled: false
  35. },
  36. series: [58.6, 34.9, 6.5],
  37. legend: { show: false },
  38. comparedResult: [2, -3, 8],
  39. labels: ['Desktop', 'Mobile', 'Tablet'],
  40. stroke: { width: 0 },
  41. colors: [$primary, $warning, $danger],
  42. fill: {
  43. type: 'gradient',
  44. gradient: {
  45. gradientToColors: [$primary_light, $warning_light, $danger_light]
  46. }
  47. }
  48. }
  49. var sessionChart = new ApexCharts(
  50. document.querySelector("#session-chart"),
  51. sessionChartoptions
  52. );
  53. sessionChart.render();
  54. // Product Order Chart
  55. // -----------------------------
  56. var orderChartoptions = {
  57. chart: {
  58. height: 325,
  59. type: 'radialBar',
  60. },
  61. colors: [$primary, $warning, $danger],
  62. fill: {
  63. type: 'gradient',
  64. gradient: {
  65. // enabled: true,
  66. shade: 'dark',
  67. type: 'vertical',
  68. shadeIntensity: 0.5,
  69. gradientToColors: [$primary_light, $warning_light, $danger_light],
  70. inverseColors: false,
  71. opacityFrom: 1,
  72. opacityTo: 1,
  73. stops: [0, 100]
  74. },
  75. },
  76. stroke: {
  77. lineCap: 'round'
  78. },
  79. plotOptions: {
  80. radialBar: {
  81. size: 150,
  82. hollow: {
  83. size: '20%'
  84. },
  85. track: {
  86. strokeWidth: '100%',
  87. margin: 15,
  88. },
  89. dataLabels: {
  90. name: {
  91. fontSize: '18px',
  92. },
  93. value: {
  94. fontSize: '16px',
  95. },
  96. total: {
  97. show: true,
  98. label: 'Total',
  99. formatter: function (w) {
  100. // By default this function returns the average of all series. The below is just an example to show the use of custom formatter function
  101. return 42459
  102. }
  103. }
  104. }
  105. }
  106. },
  107. series: [70, 52, 26],
  108. labels: ['Finished', 'Pending', 'Rejected'],
  109. }
  110. var orderChart = new ApexCharts(
  111. document.querySelector("#product-order-chart"),
  112. orderChartoptions
  113. );
  114. orderChart.render();
  115. // Customer Chart
  116. // -----------------------------
  117. var customerChartoptions = {
  118. chart: {
  119. type: 'pie',
  120. height: 325,
  121. dropShadow: {
  122. enabled: false,
  123. blur: 5,
  124. left: 1,
  125. top: 1,
  126. opacity: 0.2
  127. },
  128. toolbar: {
  129. show: false
  130. }
  131. },
  132. labels: ['New', 'Returning', 'Referrals'],
  133. series: [690, 258, 149],
  134. dataLabels: {
  135. enabled: false
  136. },
  137. legend: { show: false },
  138. stroke: {
  139. width: 5
  140. },
  141. colors: [$primary, $warning, $danger],
  142. fill: {
  143. type: 'gradient',
  144. gradient: {
  145. gradientToColors: [$primary_light, $warning_light, $danger_light]
  146. }
  147. }
  148. }
  149. var customerChart = new ApexCharts(
  150. document.querySelector("#customer-chart"),
  151. customerChartoptions
  152. );
  153. customerChart.render();
  154. // Sales Chart
  155. // -----------------------------
  156. var salesChartoptions = {
  157. chart: {
  158. height: 300,
  159. type: 'radar',
  160. dropShadow: {
  161. enabled: true,
  162. blur: 8,
  163. left: 1,
  164. top: 1,
  165. opacity: 0.2
  166. },
  167. toolbar: {
  168. show: false
  169. }
  170. },
  171. toolbar: { show: false },
  172. series: [{
  173. name: 'Sales',
  174. data: [90, 50, 86, 40, 100, 20],
  175. }, {
  176. name: 'Visit',
  177. data: [70, 75, 70, 76, 20, 85],
  178. }],
  179. stroke: {
  180. width: 0
  181. },
  182. colors: [$primary, $info],
  183. plotOptions: {
  184. radar: {
  185. polygons: {
  186. strokeColors: [$strok_color, 'transparent', 'transparent', 'transparent', 'transparent', 'transparent'],
  187. connectorColors: 'transparent'
  188. }
  189. }
  190. },
  191. fill: {
  192. type: 'gradient',
  193. gradient: {
  194. shade: 'dark',
  195. gradientToColors: ['#9f8ed7', $info_light],
  196. shadeIntensity: 1,
  197. type: 'horizontal',
  198. opacityFrom: 1,
  199. opacityTo: 1,
  200. stops: [0, 100, 100, 100]
  201. },
  202. },
  203. markers: {
  204. size: 0,
  205. },
  206. legend: {
  207. show: false,
  208. },
  209. labels: ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun'],
  210. dataLabels: {
  211. style: {
  212. colors: [$strok_color, $strok_color, $strok_color, $strok_color, $strok_color, $strok_color]
  213. }
  214. },
  215. yaxis: {
  216. show: false,
  217. },
  218. grid: {
  219. show: false,
  220. },
  221. }
  222. var salesChart = new ApexCharts(
  223. document.querySelector("#sales-chart"),
  224. salesChartoptions
  225. );
  226. salesChart.render();
  227. // Support Tracker Chart
  228. // -----------------------------
  229. var supportChartoptions = {
  230. chart: {
  231. height: 270,
  232. type: 'radialBar',
  233. sparkline:{
  234. enabled: false,
  235. }
  236. },
  237. plotOptions: {
  238. radialBar: {
  239. size: 150,
  240. offsetY: 20,
  241. startAngle: -150,
  242. endAngle: 150,
  243. hollow: {
  244. size: '65%',
  245. },
  246. track: {
  247. background: $white,
  248. strokeWidth: '100%',
  249. },
  250. dataLabels: {
  251. value: {
  252. offsetY: 30,
  253. color: '#99a2ac',
  254. fontSize: '2rem'
  255. }
  256. }
  257. },
  258. },
  259. colors: [$danger],
  260. fill: {
  261. type: 'gradient',
  262. gradient: {
  263. // enabled: true,
  264. shade: 'dark',
  265. type: 'horizontal',
  266. shadeIntensity: 0.5,
  267. gradientToColors: [$primary],
  268. inverseColors: true,
  269. opacityFrom: 1,
  270. opacityTo: 1,
  271. stops: [0, 100]
  272. },
  273. },
  274. stroke: {
  275. dashArray: 8
  276. },
  277. series: [83],
  278. labels: ['Completed Tickets'],
  279. }
  280. var supportChart = new ApexCharts(
  281. document.querySelector("#support-tracker-chart"),
  282. supportChartoptions
  283. );
  284. supportChart.render();
  285. // Revenue Chart
  286. // -----------------------------
  287. var revenueChartoptions = {
  288. chart: {
  289. height: 260,
  290. toolbar: { show: false },
  291. type: 'line',
  292. },
  293. stroke: {
  294. curve: 'smooth',
  295. dashArray: [0, 8],
  296. width: [4, 2],
  297. },
  298. grid: {
  299. borderColor: $label_color,
  300. },
  301. legend: {
  302. show: false,
  303. },
  304. colors: [$danger_light, $strok_color],
  305. fill: {
  306. type: 'gradient',
  307. gradient: {
  308. shade: 'dark',
  309. inverseColors: false,
  310. gradientToColors: [$primary, $strok_color],
  311. shadeIntensity: 1,
  312. type: 'horizontal',
  313. opacityFrom: 1,
  314. opacityTo: 1,
  315. stops: [0, 100, 100, 100]
  316. },
  317. },
  318. markers: {
  319. size: 0,
  320. hover: {
  321. size: 5
  322. }
  323. },
  324. xaxis: {
  325. labels: {
  326. style: {
  327. colors: $strok_color,
  328. }
  329. },
  330. axisTicks: {
  331. show: false,
  332. },
  333. categories: ['01', '05', '09', '13', '17', '21', '26', '31'],
  334. axisBorder: {
  335. show: false,
  336. },
  337. tickPlacement: 'on',
  338. },
  339. yaxis: {
  340. tickAmount: 5,
  341. labels: {
  342. style: {
  343. color: $strok_color,
  344. },
  345. formatter: function(val) {
  346. return val > 999 ? (val / 1000).toFixed(1) + 'k' : val;
  347. }
  348. }
  349. },
  350. tooltip: {
  351. x: { show: false }
  352. },
  353. series: [{
  354. name: "This Month",
  355. data: [45000, 47000, 44800, 47500, 45500, 48000, 46500, 48600]
  356. },
  357. {
  358. name: "Last Month",
  359. data: [46000, 48000, 45500, 46600, 44500, 46500, 45000, 47000]
  360. }
  361. ],
  362. }
  363. var revenueChart = new ApexCharts(
  364. document.querySelector("#revenue-chart"),
  365. revenueChartoptions
  366. );
  367. revenueChart.render();
  368. // Goal Overview Chart
  369. // -----------------------------
  370. var goalChartoptions = {
  371. chart: {
  372. height: 250,
  373. type: 'radialBar',
  374. sparkline: {
  375. enabled: true,
  376. },
  377. dropShadow: {
  378. enabled: true,
  379. blur: 3,
  380. left: 1,
  381. top: 1,
  382. opacity: 0.1
  383. },
  384. },
  385. colors: [$success],
  386. plotOptions: {
  387. radialBar: {
  388. size: 110,
  389. startAngle: -150,
  390. endAngle: 150,
  391. hollow: {
  392. size: '77%',
  393. },
  394. track: {
  395. background: $strok_color,
  396. strokeWidth: '50%',
  397. },
  398. dataLabels: {
  399. name: {
  400. show: false
  401. },
  402. value: {
  403. offsetY: 18,
  404. color: $strok_color,
  405. fontSize: '4rem'
  406. }
  407. }
  408. }
  409. },
  410. fill: {
  411. type: 'gradient',
  412. gradient: {
  413. shade: 'dark',
  414. type: 'horizontal',
  415. shadeIntensity: 0.5,
  416. gradientToColors: ['#00b5b5'],
  417. inverseColors: true,
  418. opacityFrom: 1,
  419. opacityTo: 1,
  420. stops: [0, 100]
  421. },
  422. },
  423. series: [83],
  424. stroke: {
  425. lineCap: 'round'
  426. },
  427. }
  428. var goalChart = new ApexCharts(
  429. document.querySelector("#goal-overview-chart"),
  430. goalChartoptions
  431. );
  432. goalChart.render();
  433. // Average Session Chart
  434. // ----------------------------------
  435. var avgsessionChartoptions = {
  436. chart: {
  437. type: 'bar',
  438. height: 200,
  439. sparkline: { enabled: true },
  440. toolbar: { show: false },
  441. },
  442. states: {
  443. hover: {
  444. filter: 'none'
  445. }
  446. },
  447. colors: [$label_color, $label_color, $primary, $label_color, $label_color, $label_color],
  448. series: [{
  449. name: 'Sessions',
  450. data: [75, 125, 225, 175, 125, 75, 25]
  451. }],
  452. grid: {
  453. show: false,
  454. padding: {
  455. left: 0,
  456. right: 0
  457. }
  458. },
  459. plotOptions: {
  460. bar: {
  461. columnWidth: '45%',
  462. distributed: true,
  463. endingShape: 'rounded'
  464. }
  465. },
  466. tooltip: {
  467. x: { show: false }
  468. },
  469. xaxis: {
  470. type: 'numeric',
  471. }
  472. }
  473. var avgsessionChart = new ApexCharts(
  474. document.querySelector("#avg-session-chart"),
  475. avgsessionChartoptions
  476. );
  477. avgsessionChart.render();
  478. // Sales Chart
  479. // -----------------------------
  480. var salesavgChartoptions = {
  481. chart: {
  482. height: 270,
  483. toolbar: { show: false },
  484. type: 'line',
  485. dropShadow: {
  486. enabled: true,
  487. top: 20,
  488. left: 2,
  489. blur: 6,
  490. opacity: 0.20
  491. },
  492. },
  493. stroke: {
  494. curve: 'smooth',
  495. width: 4,
  496. },
  497. grid: {
  498. borderColor: $label_color,
  499. },
  500. legend: {
  501. show: false,
  502. },
  503. colors: [$purple],
  504. fill: {
  505. type: 'gradient',
  506. gradient: {
  507. shade: 'dark',
  508. inverseColors: false,
  509. gradientToColors: [$primary],
  510. shadeIntensity: 1,
  511. type: 'horizontal',
  512. opacityFrom: 1,
  513. opacityTo: 1,
  514. stops: [0, 100, 100, 100]
  515. },
  516. },
  517. markers: {
  518. size: 0,
  519. hover: {
  520. size: 5
  521. }
  522. },
  523. xaxis: {
  524. labels: {
  525. style: {
  526. colors: $strok_color,
  527. }
  528. },
  529. axisTicks: {
  530. show: false,
  531. },
  532. categories: ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'July', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'],
  533. axisBorder: {
  534. show: false,
  535. },
  536. tickPlacement: 'on'
  537. },
  538. yaxis: {
  539. tickAmount: 5,
  540. labels: {
  541. style: {
  542. color: $strok_color,
  543. },
  544. formatter: function(val) {
  545. return val > 999 ? (val / 1000).toFixed(1) + 'k' : val;
  546. }
  547. }
  548. },
  549. tooltip: {
  550. x: { show: false }
  551. },
  552. series: [{
  553. name: "Sales",
  554. data: [140, 180, 150, 205, 160, 295, 125, 255, 205, 305, 240, 295]
  555. }],
  556. }
  557. var salesavgChart = new ApexCharts(
  558. document.querySelector("#sales-line-chart"),
  559. salesavgChartoptions
  560. );
  561. salesavgChart.render();
  562. // Client Retention Chart
  563. // ----------------------------------
  564. var retentionChartoptions = {
  565. chart: {
  566. stacked: true,
  567. type: 'bar',
  568. toolbar: { show: false },
  569. height: 290,
  570. },
  571. plotOptions: {
  572. bar: {
  573. columnWidth: '10%'
  574. }
  575. },
  576. colors: [$primary, $danger],
  577. series: [{
  578. name: 'New Clients',
  579. data: [175, 125, 225, 175, 160, 189, 206, 134, 159, 216, 148, 123]
  580. }, {
  581. name: 'Retained Clients',
  582. data: [-144, -155, -141, -167, -122, -143, -158, -107, -126, -131, -140, -137]
  583. }],
  584. grid: {
  585. borderColor: $label_color,
  586. padding: {
  587. left: 0,
  588. right: 0
  589. }
  590. },
  591. legend: {
  592. show: true,
  593. position: 'top',
  594. horizontalAlign: 'left',
  595. offsetX: 0,
  596. fontSize: '14px',
  597. markers: {
  598. radius: 50,
  599. width: 10,
  600. height: 10,
  601. }
  602. },
  603. dataLabels: {
  604. enabled: false
  605. },
  606. xaxis: {
  607. labels: {
  608. style: {
  609. colors: $strok_color,
  610. }
  611. },
  612. axisTicks: {
  613. show: false,
  614. },
  615. categories: ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'],
  616. axisBorder: {
  617. show: false,
  618. },
  619. },
  620. yaxis: {
  621. tickAmount: 5,
  622. labels: {
  623. style: {
  624. color: $strok_color,
  625. }
  626. }
  627. },
  628. tooltip: {
  629. x: { show: false }
  630. },
  631. }
  632. var retentionChart = new ApexCharts(
  633. document.querySelector("#client-retention-chart"),
  634. retentionChartoptions
  635. );
  636. retentionChart.render();
  637. });