Нема описа
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

ui-cards-analytics.js 46KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003
  1. /**
  2. * Card Analytics
  3. */
  4. 'use strict';
  5. (function () {
  6. let cardColor, headingColor, labelColor, fontFamily, borderColor, legendColor, heatMap1, heatMap2, heatMap3, heatMap4;
  7. if (isDarkStyle) {
  8. heatMap1 = '#333457';
  9. heatMap2 = '#3c3e75';
  10. heatMap3 = '#484b9b';
  11. heatMap4 = '#696cff';
  12. } else {
  13. heatMap1 = '#ededff';
  14. heatMap2 = '#d5d6ff';
  15. heatMap3 = '#b7b9ff';
  16. heatMap4 = '#696cff';
  17. }
  18. cardColor = config.colors.cardColor;
  19. headingColor = config.colors.headingColor;
  20. labelColor = config.colors.textMuted;
  21. borderColor = config.colors.borderColor;
  22. legendColor = config.colors.bodyColor;
  23. fontFamily = config.fontFamily;
  24. // Chart Colors
  25. const chartColors = {
  26. donut: {
  27. series1: '#5AB12C',
  28. series2: '#66C732',
  29. series3: '#8DE45F',
  30. series4: '#C6F1AF'
  31. },
  32. line: {
  33. series1: config.colors.warning,
  34. series2: config.colors.primary,
  35. series3: '#7367f029'
  36. }
  37. };
  38. // Customer Ratings - Line Charts
  39. // --------------------------------------------------------------------
  40. const customerRatingsChartEl = document.querySelector('#customerRatingsChart'),
  41. customerRatingsChartOptions = {
  42. chart: {
  43. height: 212,
  44. toolbar: { show: false },
  45. zoom: { enabled: false },
  46. type: 'line',
  47. dropShadow: {
  48. enabled: true,
  49. enabledOnSeries: [1],
  50. top: 13,
  51. left: 4,
  52. blur: 3,
  53. color: config.colors.primary,
  54. opacity: 0.09
  55. }
  56. },
  57. series: [
  58. {
  59. name: 'Last Month',
  60. data: [20, 54, 20, 38, 22, 28, 16, 19, 11]
  61. },
  62. {
  63. name: 'This Month',
  64. data: [20, 32, 22, 65, 40, 46, 34, 70, 75]
  65. }
  66. ],
  67. stroke: {
  68. curve: 'smooth',
  69. dashArray: [8, 0],
  70. width: [3, 4]
  71. },
  72. legend: {
  73. show: false
  74. },
  75. colors: [borderColor, config.colors.primary],
  76. grid: {
  77. show: false,
  78. borderColor: borderColor,
  79. padding: {
  80. top: -20,
  81. bottom: -10,
  82. left: 0
  83. }
  84. },
  85. markers: {
  86. size: 6,
  87. colors: 'transparent',
  88. strokeColors: 'transparent',
  89. strokeWidth: 5,
  90. hover: {
  91. size: 6
  92. },
  93. discrete: [
  94. {
  95. fillColor: config.colors.white,
  96. seriesIndex: 1,
  97. dataPointIndex: 8,
  98. strokeColor: config.colors.primary,
  99. size: 6
  100. },
  101. {
  102. fillColor: config.colors.white,
  103. seriesIndex: 1,
  104. dataPointIndex: 3,
  105. strokeColor: config.colors.black,
  106. size: 6
  107. }
  108. ],
  109. offsetX: -3
  110. },
  111. xaxis: {
  112. labels: {
  113. style: {
  114. colors: labelColor,
  115. fontSize: '13px'
  116. }
  117. },
  118. axisTicks: {
  119. show: false
  120. },
  121. categories: [' ', 'Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', ' '],
  122. axisBorder: {
  123. show: false
  124. }
  125. },
  126. yaxis: {
  127. show: false
  128. }
  129. };
  130. if (typeof customerRatingsChartEl !== undefined && customerRatingsChartEl !== null) {
  131. const customerRatingsChart = new ApexCharts(customerRatingsChartEl, customerRatingsChartOptions);
  132. customerRatingsChart.render();
  133. }
  134. // Sale Stats - Radial Bar Chart
  135. // --------------------------------------------------------------------
  136. const salesStatsEl = document.querySelector('#salesStats'),
  137. salesStatsOptions = {
  138. chart: {
  139. height: 276,
  140. type: 'radialBar'
  141. },
  142. series: [75],
  143. labels: ['Sales'],
  144. plotOptions: {
  145. radialBar: {
  146. startAngle: 0,
  147. endAngle: 360,
  148. strokeWidth: '70',
  149. hollow: {
  150. margin: 50,
  151. size: '75%',
  152. image: assetsPath + 'img/icons/misc/arrow-star.png',
  153. imageWidth: 65,
  154. imageHeight: 55,
  155. imageOffsetY: -35,
  156. imageClipped: false
  157. },
  158. track: {
  159. strokeWidth: '50%',
  160. background: borderColor
  161. },
  162. dataLabels: {
  163. show: true,
  164. name: {
  165. offsetY: 60,
  166. show: true,
  167. color: legendColor,
  168. fontSize: '15px',
  169. fontFamily: fontFamily
  170. },
  171. value: {
  172. formatter: function (val) {
  173. return parseInt(val) + '%';
  174. },
  175. offsetY: 20,
  176. color: headingColor,
  177. fontSize: '28px',
  178. fontWeight: '500',
  179. fontFamily: fontFamily,
  180. show: true
  181. }
  182. }
  183. }
  184. },
  185. fill: {
  186. type: 'solid',
  187. colors: config.colors.success
  188. },
  189. stroke: {
  190. lineCap: 'round'
  191. },
  192. states: {
  193. hover: {
  194. filter: {
  195. type: 'none'
  196. }
  197. },
  198. active: {
  199. filter: {
  200. type: 'none'
  201. }
  202. }
  203. }
  204. };
  205. if (typeof salesStatsEl !== undefined && salesStatsEl !== null) {
  206. const salesStats = new ApexCharts(salesStatsEl, salesStatsOptions);
  207. salesStats.render();
  208. }
  209. // Sales Analytics - Heat map chart
  210. // --------------------------------------------------------------------
  211. const salesAnalyticsChartEl = document.querySelector('#salesAnalyticsChart'),
  212. salesAnalyticsChartConfig = {
  213. chart: {
  214. height: 350,
  215. type: 'heatmap',
  216. parentHeightOffset: 0,
  217. offsetX: -10,
  218. offsetY: -15,
  219. toolbar: {
  220. show: false
  221. }
  222. },
  223. series: [
  224. {
  225. name: '1k',
  226. data: [
  227. { x: 'Jan', y: '250' },
  228. { x: 'Feb', y: '350' },
  229. { x: 'Mar', y: '220' },
  230. { x: 'Apr', y: '290' },
  231. { x: 'May', y: '650' },
  232. { x: 'Jun', y: '260' },
  233. { x: 'Jul', y: '274' },
  234. { x: 'Aug', y: '850' }
  235. ]
  236. },
  237. {
  238. name: '2k',
  239. data: [
  240. { x: 'Jan', y: '750' },
  241. { x: 'Feb', y: '3350' },
  242. { x: 'Mar', y: '1220' },
  243. { x: 'Apr', y: '1290' },
  244. { x: 'May', y: '1650' },
  245. { x: 'Jun', y: '1260' },
  246. { x: 'Jul', y: '1274' },
  247. { x: 'Aug', y: '850' }
  248. ]
  249. },
  250. {
  251. name: '3k',
  252. data: [
  253. { x: 'Jan', y: '375' },
  254. { x: 'Feb', y: '1350' },
  255. { x: 'Mar', y: '3220' },
  256. { x: 'Apr', y: '2290' },
  257. { x: 'May', y: '2650' },
  258. { x: 'Jun', y: '2260' },
  259. { x: 'Jul', y: '1274' },
  260. { x: 'Aug', y: '815' }
  261. ]
  262. },
  263. {
  264. name: '4k',
  265. data: [
  266. { x: 'Jan', y: '575' },
  267. { x: 'Feb', y: '1350' },
  268. { x: 'Mar', y: '2220' },
  269. { x: 'Apr', y: '3290' },
  270. { x: 'May', y: '3650' },
  271. { x: 'Jun', y: '2260' },
  272. { x: 'Jul', y: '1274' },
  273. { x: 'Aug', y: '315' }
  274. ]
  275. },
  276. {
  277. name: '5k',
  278. data: [
  279. { x: 'Jan', y: '875' },
  280. { x: 'Feb', y: '1350' },
  281. { x: 'Mar', y: '2220' },
  282. { x: 'Apr', y: '3290' },
  283. { x: 'May', y: '3650' },
  284. { x: 'Jun', y: '2260' },
  285. { x: 'Jul', y: '1274' },
  286. { x: 'Aug', y: '965' }
  287. ]
  288. },
  289. {
  290. name: '6k',
  291. data: [
  292. { x: 'Jan', y: '575' },
  293. { x: 'Feb', y: '1350' },
  294. { x: 'Mar', y: '2220' },
  295. { x: 'Apr', y: '2290' },
  296. { x: 'May', y: '2650' },
  297. { x: 'Jun', y: '3260' },
  298. { x: 'Jul', y: '1274' },
  299. { x: 'Aug', y: '815' }
  300. ]
  301. },
  302. {
  303. name: '7k',
  304. data: [
  305. { x: 'Jan', y: '575' },
  306. { x: 'Feb', y: '1350' },
  307. { x: 'Mar', y: '1220' },
  308. { x: 'Apr', y: '1290' },
  309. { x: 'May', y: '1650' },
  310. { x: 'Jun', y: '1260' },
  311. { x: 'Jul', y: '3274' },
  312. { x: 'Aug', y: '815' }
  313. ]
  314. },
  315. {
  316. name: '8k',
  317. data: [
  318. { x: 'Jan', y: '575' },
  319. { x: 'Feb', y: '350' },
  320. { x: 'Mar', y: '220' },
  321. { x: 'Apr', y: '290' },
  322. { x: 'May', y: '650' },
  323. { x: 'Jun', y: '260' },
  324. { x: 'Jul', y: '274' },
  325. { x: 'Aug', y: '815' }
  326. ]
  327. }
  328. ],
  329. plotOptions: {
  330. heatmap: {
  331. enableShades: false,
  332. radius: '6px',
  333. colorScale: {
  334. ranges: [
  335. {
  336. from: 0,
  337. to: 1000,
  338. name: '1k',
  339. color: heatMap1
  340. },
  341. {
  342. from: 1001,
  343. to: 2000,
  344. name: '2k',
  345. color: heatMap2
  346. },
  347. {
  348. from: 2001,
  349. to: 3000,
  350. name: '3k',
  351. color: heatMap3
  352. },
  353. {
  354. from: 3001,
  355. to: 4000,
  356. name: '4k',
  357. color: heatMap4
  358. }
  359. ]
  360. }
  361. }
  362. },
  363. dataLabels: {
  364. enabled: false
  365. },
  366. stroke: {
  367. width: 4,
  368. colors: [cardColor]
  369. },
  370. legend: {
  371. show: false
  372. },
  373. grid: {
  374. show: false,
  375. padding: {
  376. top: -15,
  377. left: 16,
  378. bottom: -7
  379. }
  380. },
  381. xaxis: {
  382. labels: {
  383. show: true,
  384. style: {
  385. colors: labelColor,
  386. fontSize: '15px',
  387. fontFamily: fontFamily
  388. }
  389. },
  390. axisBorder: {
  391. show: false
  392. },
  393. axisTicks: {
  394. show: false
  395. }
  396. },
  397. yaxis: {
  398. labels: {
  399. style: {
  400. colors: labelColor,
  401. fontSize: '15px',
  402. fontFamily: fontFamily
  403. }
  404. }
  405. },
  406. responsive: [
  407. {
  408. breakpoint: 1441,
  409. options: {
  410. chart: {
  411. height: '325px'
  412. },
  413. grid: {
  414. padding: {
  415. right: -15
  416. }
  417. }
  418. }
  419. },
  420. {
  421. breakpoint: 1045,
  422. options: {
  423. chart: {
  424. height: '300px'
  425. },
  426. grid: {
  427. padding: {
  428. right: -50
  429. }
  430. }
  431. }
  432. },
  433. {
  434. breakpoint: 992,
  435. options: {
  436. chart: {
  437. height: '320px'
  438. },
  439. grid: {
  440. padding: {
  441. right: -50
  442. }
  443. }
  444. }
  445. },
  446. {
  447. breakpoint: 767,
  448. options: {
  449. chart: {
  450. height: '400px'
  451. },
  452. grid: {
  453. padding: {
  454. right: 0
  455. }
  456. }
  457. }
  458. },
  459. {
  460. breakpoint: 568,
  461. options: {
  462. chart: {
  463. height: '330px'
  464. },
  465. grid: {
  466. padding: {
  467. right: -20
  468. }
  469. }
  470. }
  471. }
  472. ],
  473. states: {
  474. hover: {
  475. filter: {
  476. type: 'none'
  477. }
  478. },
  479. active: {
  480. filter: {
  481. type: 'none'
  482. }
  483. }
  484. }
  485. };
  486. if (typeof salesAnalyticsChartEl !== undefined && salesAnalyticsChartEl !== null) {
  487. const salesAnalyticsChart = new ApexCharts(salesAnalyticsChartEl, salesAnalyticsChartConfig);
  488. salesAnalyticsChart.render();
  489. }
  490. // Overview & Sales Activity - Staked Bar Chart
  491. // --------------------------------------------------------------------
  492. const salesActivityChartEl = document.querySelector('#salesActivityChart'),
  493. salesActivityChartConfig = {
  494. chart: {
  495. type: 'bar',
  496. height: 235,
  497. stacked: true,
  498. toolbar: {
  499. show: false
  500. }
  501. },
  502. series: [
  503. {
  504. name: 'PRODUCT A',
  505. data: [75, 50, 55, 60, 48, 82, 59]
  506. },
  507. {
  508. name: 'PRODUCT B',
  509. data: [25, 29, 32, 35, 34, 18, 30]
  510. }
  511. ],
  512. plotOptions: {
  513. bar: {
  514. horizontal: false,
  515. columnWidth: '40%',
  516. borderRadius: 9,
  517. startingShape: 'rounded',
  518. endingShape: 'rounded',
  519. borderRadiusApplication: 'around'
  520. }
  521. },
  522. dataLabels: {
  523. enabled: false
  524. },
  525. stroke: {
  526. curve: 'smooth',
  527. width: 6,
  528. lineCap: 'round',
  529. colors: [cardColor]
  530. },
  531. legend: {
  532. show: false
  533. },
  534. colors: [config.colors.danger, config.colors.secondary],
  535. fill: {
  536. opacity: 1
  537. },
  538. grid: {
  539. show: false,
  540. strokeDashArray: 7,
  541. padding: {
  542. top: -40,
  543. left: 0,
  544. right: 0
  545. }
  546. },
  547. xaxis: {
  548. categories: ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul'],
  549. labels: {
  550. show: true,
  551. style: {
  552. colors: labelColor,
  553. fontSize: '15px',
  554. fontFamily: fontFamily
  555. }
  556. },
  557. axisBorder: {
  558. show: false
  559. },
  560. axisTicks: {
  561. show: false
  562. }
  563. },
  564. yaxis: {
  565. show: false
  566. },
  567. responsive: [
  568. {
  569. breakpoint: 1440,
  570. options: {
  571. plotOptions: {
  572. bar: {
  573. borderRadius: 10,
  574. columnWidth: '50%'
  575. }
  576. }
  577. }
  578. },
  579. {
  580. breakpoint: 1300,
  581. options: {
  582. plotOptions: {
  583. bar: {
  584. borderRadius: 11,
  585. columnWidth: '55%'
  586. }
  587. }
  588. }
  589. },
  590. {
  591. breakpoint: 1200,
  592. options: {
  593. plotOptions: {
  594. bar: {
  595. borderRadius: 10,
  596. columnWidth: '45%'
  597. }
  598. }
  599. }
  600. },
  601. {
  602. breakpoint: 1040,
  603. options: {
  604. plotOptions: {
  605. bar: {
  606. borderRadius: 10,
  607. columnWidth: '50%'
  608. }
  609. }
  610. }
  611. },
  612. {
  613. breakpoint: 992,
  614. options: {
  615. plotOptions: {
  616. bar: {
  617. borderRadius: 12,
  618. columnWidth: '40%'
  619. }
  620. },
  621. chart: {
  622. type: 'bar',
  623. height: 320
  624. }
  625. }
  626. },
  627. {
  628. breakpoint: 768,
  629. options: {
  630. plotOptions: {
  631. bar: {
  632. borderRadius: 11,
  633. columnWidth: '25%'
  634. }
  635. }
  636. }
  637. },
  638. {
  639. breakpoint: 576,
  640. options: {
  641. plotOptions: {
  642. bar: {
  643. borderRadius: 10,
  644. columnWidth: '35%'
  645. }
  646. }
  647. }
  648. },
  649. {
  650. breakpoint: 440,
  651. options: {
  652. plotOptions: {
  653. bar: {
  654. borderRadius: 10,
  655. columnWidth: '45%'
  656. }
  657. }
  658. }
  659. },
  660. {
  661. breakpoint: 360,
  662. options: {
  663. plotOptions: {
  664. bar: {
  665. borderRadius: 8,
  666. columnWidth: '50%'
  667. }
  668. }
  669. }
  670. }
  671. ],
  672. states: {
  673. hover: {
  674. filter: {
  675. type: 'none'
  676. }
  677. },
  678. active: {
  679. filter: {
  680. type: 'none'
  681. }
  682. }
  683. }
  684. };
  685. if (typeof salesActivityChartEl !== undefined && salesActivityChartEl !== null) {
  686. const salesActivityChart = new ApexCharts(salesActivityChartEl, salesActivityChartConfig);
  687. salesActivityChart.render();
  688. }
  689. // Total Income - Area Chart
  690. // --------------------------------------------------------------------
  691. const totalIncomeEl = document.querySelector('#totalIncomeChart'),
  692. totalIncomeConfig = {
  693. chart: {
  694. height: 250,
  695. type: 'area',
  696. toolbar: false,
  697. dropShadow: {
  698. enabled: true,
  699. top: 14,
  700. left: 2,
  701. blur: 3,
  702. color: config.colors.primary,
  703. opacity: 0.15
  704. }
  705. },
  706. series: [
  707. {
  708. data: [3350, 3350, 4800, 4800, 2950, 2950, 1800, 1800, 3750, 3750, 5700, 5700]
  709. }
  710. ],
  711. dataLabels: {
  712. enabled: false
  713. },
  714. stroke: {
  715. width: 3,
  716. curve: 'straight'
  717. },
  718. colors: [config.colors.primary],
  719. fill: {
  720. type: 'gradient',
  721. gradient: {
  722. shadeIntensity: 1,
  723. opacityFrom: 0.3,
  724. gradientToColors: [config.colors.cardColor],
  725. opacityTo: 0.3,
  726. stops: [0, 100]
  727. }
  728. },
  729. grid: {
  730. show: true,
  731. strokeDashArray: 10,
  732. borderColor: borderColor,
  733. padding: {
  734. top: -15,
  735. bottom: -10,
  736. left: 0,
  737. right: 0
  738. }
  739. },
  740. xaxis: {
  741. categories: ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'],
  742. labels: {
  743. offsetX: 0,
  744. style: {
  745. colors: labelColor,
  746. fontFamily: fontFamily,
  747. fontSize: '13px'
  748. }
  749. },
  750. axisBorder: {
  751. show: false
  752. },
  753. axisTicks: {
  754. show: false
  755. },
  756. lines: {
  757. show: false
  758. }
  759. },
  760. yaxis: {
  761. labels: {
  762. offsetX: -15,
  763. formatter: function (val) {
  764. return '$' + parseInt(val / 1000) + 'k';
  765. },
  766. style: {
  767. fontSize: '13px',
  768. fontFamily: fontFamily,
  769. colors: labelColor
  770. }
  771. },
  772. min: 1000,
  773. max: 6000,
  774. tickAmount: 5
  775. }
  776. };
  777. if (typeof totalIncomeEl !== undefined && totalIncomeEl !== null) {
  778. const totalIncome = new ApexCharts(totalIncomeEl, totalIncomeConfig);
  779. totalIncome.render();
  780. }
  781. // Income Chart - Area chart
  782. // --------------------------------------------------------------------
  783. const incomeChartEl = document.querySelector('#incomeChart'),
  784. incomeChartConfig = {
  785. series: [
  786. {
  787. data: [21, 30, 22, 42, 26, 35, 29]
  788. }
  789. ],
  790. chart: {
  791. height: 200,
  792. parentHeightOffset: 0,
  793. parentWidthOffset: 0,
  794. toolbar: {
  795. show: false
  796. },
  797. type: 'area'
  798. },
  799. dataLabels: {
  800. enabled: false
  801. },
  802. stroke: {
  803. width: 3,
  804. curve: 'smooth'
  805. },
  806. legend: {
  807. show: false
  808. },
  809. markers: {
  810. size: 6,
  811. colors: 'transparent',
  812. strokeColors: 'transparent',
  813. strokeWidth: 4,
  814. discrete: [
  815. {
  816. fillColor: config.colors.white,
  817. seriesIndex: 0,
  818. dataPointIndex: 6,
  819. strokeColor: config.colors.primary,
  820. strokeWidth: 2,
  821. size: 6,
  822. radius: 8
  823. }
  824. ],
  825. offsetX: -1,
  826. hover: {
  827. size: 7
  828. }
  829. },
  830. colors: [config.colors.primary],
  831. fill: {
  832. type: 'gradient',
  833. gradient: {
  834. shadeIntensity: 1,
  835. opacityFrom: 0.3,
  836. gradientToColors: [config.colors.cardColor],
  837. opacityTo: 0.3,
  838. stops: [0, 100]
  839. }
  840. },
  841. grid: {
  842. borderColor: borderColor,
  843. strokeDashArray: 8,
  844. padding: {
  845. top: -20,
  846. bottom: -8,
  847. left: 0,
  848. right: 8
  849. }
  850. },
  851. xaxis: {
  852. categories: ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul'],
  853. axisBorder: {
  854. show: false
  855. },
  856. axisTicks: {
  857. show: false
  858. },
  859. labels: {
  860. show: true,
  861. style: {
  862. fontSize: '13px',
  863. colors: labelColor
  864. }
  865. }
  866. },
  867. yaxis: {
  868. labels: {
  869. show: false
  870. },
  871. min: 10,
  872. max: 50,
  873. tickAmount: 4
  874. }
  875. };
  876. if (typeof incomeChartEl !== undefined && incomeChartEl !== null) {
  877. const incomeChart = new ApexCharts(incomeChartEl, incomeChartConfig);
  878. incomeChart.render();
  879. }
  880. // Expenses Mini Chart - Radial Chart
  881. // --------------------------------------------------------------------
  882. const weeklyExpensesEl = document.querySelector('#expensesOfWeek'),
  883. weeklyExpensesConfig = {
  884. series: [65],
  885. chart: {
  886. width: 60,
  887. height: 60,
  888. type: 'radialBar'
  889. },
  890. plotOptions: {
  891. radialBar: {
  892. startAngle: 0,
  893. endAngle: 360,
  894. strokeWidth: '8',
  895. hollow: {
  896. margin: 2,
  897. size: '40%'
  898. },
  899. track: {
  900. background: borderColor
  901. },
  902. dataLabels: {
  903. show: true,
  904. name: {
  905. show: false
  906. },
  907. value: {
  908. formatter: function (val) {
  909. return '$' + parseInt(val);
  910. },
  911. offsetY: 5,
  912. color: legendColor,
  913. fontSize: '12px',
  914. fontFamily: fontFamily,
  915. show: true
  916. }
  917. }
  918. }
  919. },
  920. fill: {
  921. type: 'solid',
  922. colors: config.colors.primary
  923. },
  924. stroke: {
  925. lineCap: 'round'
  926. },
  927. grid: {
  928. padding: {
  929. top: -10,
  930. bottom: -15,
  931. left: -10,
  932. right: -10
  933. }
  934. },
  935. states: {
  936. hover: {
  937. filter: {
  938. type: 'none'
  939. }
  940. },
  941. active: {
  942. filter: {
  943. type: 'none'
  944. }
  945. }
  946. }
  947. };
  948. if (typeof weeklyExpensesEl !== undefined && weeklyExpensesEl !== null) {
  949. const weeklyExpenses = new ApexCharts(weeklyExpensesEl, weeklyExpensesConfig);
  950. weeklyExpenses.render();
  951. }
  952. // Performance - Radar Chart
  953. // --------------------------------------------------------------------
  954. const performanceChartEl = document.querySelector('#performanceChart'),
  955. performanceChartConfig = {
  956. series: [
  957. {
  958. name: 'Income',
  959. data: [26, 29, 31, 40, 29, 24]
  960. },
  961. {
  962. name: 'Earning',
  963. data: [30, 26, 24, 26, 24, 40]
  964. }
  965. ],
  966. chart: {
  967. height: 310,
  968. type: 'radar',
  969. toolbar: {
  970. show: false
  971. },
  972. dropShadow: {
  973. enabled: true,
  974. enabledOnSeries: undefined,
  975. top: 6,
  976. left: 0,
  977. blur: 6,
  978. color: '#000',
  979. opacity: 0.14
  980. }
  981. },
  982. plotOptions: {
  983. radar: {
  984. polygons: {
  985. strokeColors: borderColor,
  986. connectorColors: borderColor
  987. }
  988. }
  989. },
  990. stroke: {
  991. show: false,
  992. width: 0
  993. },
  994. legend: {
  995. show: true,
  996. fontSize: '13px',
  997. position: 'bottom',
  998. labels: {
  999. colors: legendColor,
  1000. useSeriesColors: false
  1001. },
  1002. markers: {
  1003. height: 10,
  1004. width: 10,
  1005. offsetX: -5
  1006. },
  1007. itemMargin: {
  1008. horizontal: 10
  1009. },
  1010. onItemHover: {
  1011. highlightDataSeries: false
  1012. }
  1013. },
  1014. colors: [config.colors.primary, config.colors.info],
  1015. fill: {
  1016. opacity: [1, 0.85]
  1017. },
  1018. markers: {
  1019. size: 0
  1020. },
  1021. grid: {
  1022. show: false,
  1023. padding: {
  1024. top: -8,
  1025. bottom: -5
  1026. }
  1027. },
  1028. xaxis: {
  1029. categories: ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun'],
  1030. labels: {
  1031. show: true,
  1032. style: {
  1033. colors: [labelColor, labelColor, labelColor, labelColor, labelColor, labelColor],
  1034. fontSize: '13px',
  1035. fontFamily: fontFamily
  1036. }
  1037. }
  1038. },
  1039. yaxis: {
  1040. show: false,
  1041. min: 0,
  1042. max: 40,
  1043. tickAmount: 4
  1044. }
  1045. };
  1046. if (typeof performanceChartEl !== undefined && performanceChartEl !== null) {
  1047. const performanceChart = new ApexCharts(performanceChartEl, performanceChartConfig);
  1048. performanceChart.render();
  1049. }
  1050. // Total Balance - Line Chart
  1051. // --------------------------------------------------------------------
  1052. const totalBalanceChartEl = document.querySelector('#totalBalanceChart'),
  1053. totalBalanceChartConfig = {
  1054. series: [
  1055. {
  1056. data: [137, 210, 160, 275, 205, 315]
  1057. }
  1058. ],
  1059. chart: {
  1060. height: 245,
  1061. parentHeightOffset: 0,
  1062. parentWidthOffset: 0,
  1063. type: 'line',
  1064. dropShadow: {
  1065. enabled: true,
  1066. top: 10,
  1067. left: 5,
  1068. blur: 3,
  1069. color: config.colors.warning,
  1070. opacity: 0.15
  1071. },
  1072. toolbar: {
  1073. show: false
  1074. }
  1075. },
  1076. dataLabels: {
  1077. enabled: false
  1078. },
  1079. stroke: {
  1080. width: 4,
  1081. curve: 'smooth'
  1082. },
  1083. legend: {
  1084. show: false
  1085. },
  1086. colors: [config.colors.warning],
  1087. markers: {
  1088. size: 6,
  1089. colors: 'transparent',
  1090. strokeColors: 'transparent',
  1091. strokeWidth: 4,
  1092. discrete: [
  1093. {
  1094. fillColor: config.colors.white,
  1095. seriesIndex: 0,
  1096. dataPointIndex: 5,
  1097. strokeColor: config.colors.warning,
  1098. strokeWidth: 8,
  1099. size: 6,
  1100. radius: 8
  1101. }
  1102. ],
  1103. hover: {
  1104. size: 9
  1105. }
  1106. },
  1107. grid: {
  1108. show: false,
  1109. padding: {
  1110. top: -10,
  1111. left: 0,
  1112. right: 0,
  1113. bottom: 10
  1114. }
  1115. },
  1116. xaxis: {
  1117. categories: ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun'],
  1118. axisBorder: {
  1119. show: false
  1120. },
  1121. axisTicks: {
  1122. show: false
  1123. },
  1124. labels: {
  1125. show: true,
  1126. style: {
  1127. fontSize: '13px',
  1128. fontFamily: fontFamily,
  1129. colors: labelColor
  1130. }
  1131. }
  1132. },
  1133. yaxis: {
  1134. labels: {
  1135. show: false
  1136. }
  1137. }
  1138. };
  1139. if (typeof totalBalanceChartEl !== undefined && totalBalanceChartEl !== null) {
  1140. const totalBalanceChart = new ApexCharts(totalBalanceChartEl, totalBalanceChartConfig);
  1141. totalBalanceChart.render();
  1142. }
  1143. // Session Overview Chart - Radial Bar
  1144. // --------------------------------------------------------------------
  1145. const sessionOverviewChartEl = document.querySelector('#sessionOverviewChart'),
  1146. sessionOverviewChartOptions = {
  1147. series: [78],
  1148. labels: ['Loss Rate'],
  1149. chart: {
  1150. height: 175,
  1151. type: 'radialBar'
  1152. },
  1153. colors: [config.colors.warning],
  1154. plotOptions: {
  1155. radialBar: {
  1156. offsetY: 0,
  1157. startAngle: -140,
  1158. endAngle: 140,
  1159. hollow: {
  1160. size: '70%'
  1161. },
  1162. track: {
  1163. strokeWidth: '60%',
  1164. background: borderColor
  1165. },
  1166. dataLabels: {
  1167. name: {
  1168. offsetY: 55,
  1169. color: labelColor,
  1170. fontSize: '13px',
  1171. fontFamily: fontFamily
  1172. },
  1173. value: {
  1174. offsetY: -10,
  1175. color: headingColor,
  1176. fontSize: '24px',
  1177. fontWeight: '500',
  1178. fontFamily: fontFamily
  1179. }
  1180. }
  1181. }
  1182. },
  1183. stroke: {
  1184. lineCap: 'round'
  1185. },
  1186. states: {
  1187. hover: {
  1188. filter: {
  1189. type: 'none'
  1190. }
  1191. },
  1192. active: {
  1193. filter: {
  1194. type: 'none'
  1195. }
  1196. }
  1197. }
  1198. };
  1199. if (typeof sessionOverviewChartEl !== undefined && sessionOverviewChartEl !== null) {
  1200. const sessionOverviewChart = new ApexCharts(sessionOverviewChartEl, sessionOverviewChartOptions);
  1201. sessionOverviewChart.render();
  1202. }
  1203. // Score Chart - Radial Bar Chart
  1204. // --------------------------------------------------------------------
  1205. const scoreChartEl = document.querySelector('#scoreChart'),
  1206. scoreChartOptions = {
  1207. series: [78],
  1208. labels: ['Out of 100'],
  1209. chart: {
  1210. height: 220,
  1211. type: 'radialBar'
  1212. },
  1213. plotOptions: {
  1214. radialBar: {
  1215. size: 150,
  1216. offsetY: 10,
  1217. startAngle: -150,
  1218. endAngle: 150,
  1219. hollow: {
  1220. size: '55%'
  1221. },
  1222. track: {
  1223. background: cardColor,
  1224. strokeWidth: '100%'
  1225. },
  1226. dataLabels: {
  1227. name: {
  1228. offsetY: 15,
  1229. color: legendColor,
  1230. fontSize: '15px',
  1231. fontFamily: fontFamily
  1232. },
  1233. value: {
  1234. offsetY: -20,
  1235. color: headingColor,
  1236. fontSize: '24px',
  1237. fontWeight: '500',
  1238. fontFamily: fontFamily
  1239. }
  1240. }
  1241. }
  1242. },
  1243. colors: [config.colors.primary],
  1244. fill: {
  1245. type: 'gradient',
  1246. gradient: {
  1247. shade: 'dark',
  1248. shadeIntensity: 0.5,
  1249. gradientToColors: [config.colors.primary],
  1250. inverseColors: true,
  1251. opacityFrom: 1,
  1252. opacityTo: 0.6,
  1253. stops: [30, 70, 100]
  1254. }
  1255. },
  1256. stroke: {
  1257. dashArray: 5
  1258. },
  1259. grid: {
  1260. padding: {
  1261. top: -35,
  1262. bottom: -10
  1263. }
  1264. },
  1265. responsive: [
  1266. {
  1267. breakpoint: 991,
  1268. options: {
  1269. chart: {
  1270. height: '350px'
  1271. }
  1272. }
  1273. }
  1274. ],
  1275. states: {
  1276. hover: {
  1277. filter: {
  1278. type: 'none'
  1279. }
  1280. },
  1281. active: {
  1282. filter: {
  1283. type: 'none'
  1284. }
  1285. }
  1286. }
  1287. };
  1288. if (typeof scoreChartEl !== undefined && scoreChartEl !== null) {
  1289. const scoreChart = new ApexCharts(scoreChartEl, scoreChartOptions);
  1290. scoreChart.render();
  1291. }
  1292. // Total Revenue Report Chart - Bar Chart
  1293. // --------------------------------------------------------------------
  1294. const totalRevenueChartEl = document.querySelector('#totalRevenueChart'),
  1295. totalRevenueChartOptions = {
  1296. series: [
  1297. {
  1298. name: new Date().getFullYear() - 1,
  1299. data: [18, 7, 15, 29, 18, 12, 9]
  1300. },
  1301. {
  1302. name: new Date().getFullYear() - 2,
  1303. data: [-13, -18, -9, -14, -8, -17, -15]
  1304. }
  1305. ],
  1306. chart: {
  1307. height: 300,
  1308. stacked: true,
  1309. type: 'bar',
  1310. toolbar: { show: false }
  1311. },
  1312. plotOptions: {
  1313. bar: {
  1314. horizontal: false,
  1315. columnWidth: '30%',
  1316. borderRadius: 8,
  1317. startingShape: 'rounded',
  1318. endingShape: 'rounded',
  1319. borderRadiusApplication: 'around'
  1320. }
  1321. },
  1322. colors: [config.colors.primary, config.colors.info],
  1323. dataLabels: {
  1324. enabled: false
  1325. },
  1326. stroke: {
  1327. curve: 'smooth',
  1328. width: 6,
  1329. lineCap: 'round',
  1330. colors: [cardColor]
  1331. },
  1332. legend: {
  1333. show: true,
  1334. horizontalAlign: 'left',
  1335. position: 'top',
  1336. markers: {
  1337. height: 8,
  1338. width: 8,
  1339. radius: 12,
  1340. shape: 'circle',
  1341. offsetX: -5
  1342. },
  1343. fontSize: '13px',
  1344. fontFamily: fontFamily,
  1345. fontWeight: 400,
  1346. labels: {
  1347. colors: legendColor,
  1348. useSeriesColors: false
  1349. },
  1350. itemMargin: {
  1351. horizontal: 10
  1352. }
  1353. },
  1354. grid: {
  1355. strokeDashArray: 7,
  1356. borderColor: borderColor,
  1357. padding: {
  1358. top: 0,
  1359. bottom: -8,
  1360. left: 20,
  1361. right: 20
  1362. }
  1363. },
  1364. fill: {
  1365. opacity: [1, 1]
  1366. },
  1367. xaxis: {
  1368. categories: ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul'],
  1369. labels: {
  1370. style: {
  1371. fontSize: '13px',
  1372. fontFamily: fontFamily,
  1373. colors: labelColor
  1374. }
  1375. },
  1376. axisTicks: {
  1377. show: false
  1378. },
  1379. axisBorder: {
  1380. show: false
  1381. }
  1382. },
  1383. yaxis: {
  1384. labels: {
  1385. style: {
  1386. fontSize: '13px',
  1387. fontFamily: fontFamily,
  1388. colors: labelColor
  1389. }
  1390. }
  1391. },
  1392. responsive: [
  1393. {
  1394. breakpoint: 1700,
  1395. options: {
  1396. plotOptions: {
  1397. bar: {
  1398. borderRadius: 10,
  1399. columnWidth: '35%'
  1400. }
  1401. }
  1402. }
  1403. },
  1404. {
  1405. breakpoint: 1440,
  1406. options: {
  1407. plotOptions: {
  1408. bar: {
  1409. borderRadius: 12,
  1410. columnWidth: '43%'
  1411. }
  1412. }
  1413. }
  1414. },
  1415. {
  1416. breakpoint: 1300,
  1417. options: {
  1418. plotOptions: {
  1419. bar: {
  1420. borderRadius: 11,
  1421. columnWidth: '45%'
  1422. }
  1423. }
  1424. }
  1425. },
  1426. {
  1427. breakpoint: 1200,
  1428. options: {
  1429. plotOptions: {
  1430. bar: {
  1431. borderRadius: 11,
  1432. columnWidth: '37%'
  1433. }
  1434. }
  1435. }
  1436. },
  1437. {
  1438. breakpoint: 1040,
  1439. options: {
  1440. plotOptions: {
  1441. bar: {
  1442. borderRadius: 12,
  1443. columnWidth: '45%'
  1444. }
  1445. }
  1446. }
  1447. },
  1448. {
  1449. breakpoint: 991,
  1450. options: {
  1451. plotOptions: {
  1452. bar: {
  1453. borderRadius: 12,
  1454. columnWidth: '33%'
  1455. }
  1456. }
  1457. }
  1458. },
  1459. {
  1460. breakpoint: 768,
  1461. options: {
  1462. plotOptions: {
  1463. bar: {
  1464. borderRadius: 11,
  1465. columnWidth: '28%'
  1466. }
  1467. }
  1468. }
  1469. },
  1470. {
  1471. breakpoint: 640,
  1472. options: {
  1473. plotOptions: {
  1474. bar: {
  1475. borderRadius: 11,
  1476. columnWidth: '30%'
  1477. }
  1478. }
  1479. }
  1480. },
  1481. {
  1482. breakpoint: 576,
  1483. options: {
  1484. plotOptions: {
  1485. bar: {
  1486. borderRadius: 10,
  1487. columnWidth: '38%'
  1488. }
  1489. }
  1490. }
  1491. },
  1492. {
  1493. breakpoint: 440,
  1494. options: {
  1495. plotOptions: {
  1496. bar: {
  1497. borderRadius: 10,
  1498. columnWidth: '50%'
  1499. }
  1500. }
  1501. }
  1502. },
  1503. {
  1504. breakpoint: 380,
  1505. options: {
  1506. plotOptions: {
  1507. bar: {
  1508. borderRadius: 9,
  1509. columnWidth: '60%'
  1510. }
  1511. }
  1512. }
  1513. }
  1514. ],
  1515. states: {
  1516. hover: {
  1517. filter: {
  1518. type: 'none'
  1519. }
  1520. },
  1521. active: {
  1522. filter: {
  1523. type: 'none'
  1524. }
  1525. }
  1526. }
  1527. };
  1528. if (typeof totalRevenueChartEl !== undefined && totalRevenueChartEl !== null) {
  1529. const totalRevenueChart = new ApexCharts(totalRevenueChartEl, totalRevenueChartOptions);
  1530. totalRevenueChart.render();
  1531. }
  1532. // Growth Chart - Radial Bar Chart
  1533. // --------------------------------------------------------------------
  1534. const growthChartEl = document.querySelector('#growthChart'),
  1535. growthChartOptions = {
  1536. series: [78],
  1537. labels: ['Growth'],
  1538. chart: {
  1539. height: 210,
  1540. type: 'radialBar'
  1541. },
  1542. plotOptions: {
  1543. radialBar: {
  1544. size: 150,
  1545. offsetY: 10,
  1546. startAngle: -150,
  1547. endAngle: 150,
  1548. hollow: {
  1549. size: '55%'
  1550. },
  1551. track: {
  1552. background: cardColor,
  1553. strokeWidth: '100%'
  1554. },
  1555. dataLabels: {
  1556. name: {
  1557. offsetY: 15,
  1558. color: legendColor,
  1559. fontSize: '15px',
  1560. fontWeight: '500',
  1561. fontFamily: fontFamily
  1562. },
  1563. value: {
  1564. offsetY: -25,
  1565. color: headingColor,
  1566. fontSize: '22px',
  1567. fontWeight: '500',
  1568. fontFamily: fontFamily
  1569. }
  1570. }
  1571. }
  1572. },
  1573. colors: [config.colors.primary],
  1574. fill: {
  1575. type: 'gradient',
  1576. gradient: {
  1577. shade: 'dark',
  1578. shadeIntensity: 0.5,
  1579. gradientToColors: [config.colors.primary],
  1580. inverseColors: true,
  1581. opacityFrom: 1,
  1582. opacityTo: 0.6,
  1583. stops: [30, 70, 100]
  1584. }
  1585. },
  1586. stroke: {
  1587. dashArray: 5
  1588. },
  1589. grid: {
  1590. padding: {
  1591. top: -35,
  1592. bottom: -10
  1593. }
  1594. },
  1595. states: {
  1596. hover: {
  1597. filter: {
  1598. type: 'none'
  1599. }
  1600. },
  1601. active: {
  1602. filter: {
  1603. type: 'none'
  1604. }
  1605. }
  1606. }
  1607. };
  1608. if (typeof growthChartEl !== undefined && growthChartEl !== null) {
  1609. const growthChart = new ApexCharts(growthChartEl, growthChartOptions);
  1610. growthChart.render();
  1611. }
  1612. // datatbale horizontalBar chart
  1613. const horizontalBarChartEl = document.querySelector('#horizontalBarChart'),
  1614. horizontalBarChartConfig = {
  1615. chart: {
  1616. height: 360,
  1617. type: 'bar',
  1618. toolbar: {
  1619. show: false
  1620. }
  1621. },
  1622. plotOptions: {
  1623. bar: {
  1624. horizontal: true,
  1625. barHeight: '60%',
  1626. distributed: true,
  1627. startingShape: 'rounded',
  1628. borderRadiusApplication: 'end',
  1629. borderRadius: 7
  1630. }
  1631. },
  1632. grid: {
  1633. strokeDashArray: 10,
  1634. borderColor: borderColor,
  1635. xaxis: {
  1636. lines: {
  1637. show: true
  1638. }
  1639. },
  1640. yaxis: {
  1641. lines: {
  1642. show: false
  1643. }
  1644. },
  1645. padding: {
  1646. top: -35,
  1647. bottom: -12
  1648. }
  1649. },
  1650. colors: [
  1651. config.colors.primary,
  1652. config.colors.info,
  1653. config.colors.success,
  1654. config.colors.secondary,
  1655. config.colors.danger,
  1656. config.colors.warning
  1657. ],
  1658. fill: {
  1659. opacity: [1, 1, 1, 1, 1, 1]
  1660. },
  1661. dataLabels: {
  1662. enabled: true,
  1663. style: {
  1664. colors: ['#fff'],
  1665. fontWeight: 400,
  1666. fontSize: '13px',
  1667. fontFamily: fontFamily
  1668. },
  1669. formatter: function (val, opts) {
  1670. return horizontalBarChartConfig.labels[opts.dataPointIndex];
  1671. },
  1672. offsetX: 0,
  1673. dropShadow: {
  1674. enabled: false
  1675. }
  1676. },
  1677. labels: ['UI Design', 'UX Design', 'Music', 'Animation', 'React', 'SEO'],
  1678. series: [
  1679. {
  1680. data: [35, 20, 14, 12, 10, 9]
  1681. }
  1682. ],
  1683. xaxis: {
  1684. categories: ['6', '5', '4', '3', '2', '1'],
  1685. axisBorder: {
  1686. show: false
  1687. },
  1688. axisTicks: {
  1689. show: false
  1690. },
  1691. labels: {
  1692. style: {
  1693. colors: labelColor,
  1694. fontFamily: fontFamily,
  1695. fontSize: '13px'
  1696. },
  1697. formatter: function (val) {
  1698. return `${val}%`;
  1699. }
  1700. }
  1701. },
  1702. yaxis: {
  1703. max: 35,
  1704. labels: {
  1705. style: {
  1706. colors: [labelColor],
  1707. fontFamily: fontFamily,
  1708. fontSize: '13px'
  1709. }
  1710. }
  1711. },
  1712. tooltip: {
  1713. enabled: true,
  1714. style: {
  1715. fontSize: '12px'
  1716. },
  1717. onDatasetHover: {
  1718. highlightDataSeries: false
  1719. },
  1720. custom: function ({ series, seriesIndex, dataPointIndex, w }) {
  1721. return '<div class="px-3 py-2">' + '<span>' + series[seriesIndex][dataPointIndex] + '%</span>' + '</div>';
  1722. }
  1723. },
  1724. legend: {
  1725. show: false
  1726. }
  1727. };
  1728. if (typeof horizontalBarChartEl !== undefined && horizontalBarChartEl !== null) {
  1729. const horizontalBarChart = new ApexCharts(horizontalBarChartEl, horizontalBarChartConfig);
  1730. horizontalBarChart.render();
  1731. }
  1732. // Reasons for delivery exceptions Chart
  1733. // --------------------------------------------------------------------
  1734. const deliveryExceptionsChartE1 = document.querySelector('#deliveryExceptionsChart'),
  1735. deliveryExceptionsChartConfig = {
  1736. chart: {
  1737. height: 396,
  1738. parentHeightOffset: 0,
  1739. type: 'donut'
  1740. },
  1741. labels: ['Incorrect address', 'Weather conditions', 'Federal Holidays', 'Damage during transit'],
  1742. series: [13, 25, 22, 40],
  1743. colors: [
  1744. chartColors.donut.series1,
  1745. chartColors.donut.series2,
  1746. chartColors.donut.series3,
  1747. chartColors.donut.series4
  1748. ],
  1749. stroke: {
  1750. width: 0
  1751. },
  1752. dataLabels: {
  1753. enabled: false,
  1754. formatter: function (val, opt) {
  1755. return parseInt(val) + '%';
  1756. }
  1757. },
  1758. legend: {
  1759. show: true,
  1760. position: 'bottom',
  1761. offsetY: 10,
  1762. markers: {
  1763. width: 8,
  1764. height: 8,
  1765. offsetX: -3
  1766. },
  1767. itemMargin: {
  1768. horizontal: 15,
  1769. vertical: 5
  1770. },
  1771. fontSize: '13px',
  1772. fontFamily: fontFamily,
  1773. fontWeight: 400,
  1774. labels: {
  1775. colors: headingColor,
  1776. useSeriesColors: false
  1777. }
  1778. },
  1779. tooltip: {
  1780. theme: false
  1781. },
  1782. grid: {
  1783. padding: {
  1784. top: 15
  1785. }
  1786. },
  1787. plotOptions: {
  1788. pie: {
  1789. donut: {
  1790. size: '75%',
  1791. labels: {
  1792. show: true,
  1793. value: {
  1794. fontSize: '24px',
  1795. fontFamily: fontFamily,
  1796. color: headingColor,
  1797. fontWeight: 500,
  1798. offsetY: -20,
  1799. formatter: function (val) {
  1800. return parseInt(val) + '%';
  1801. }
  1802. },
  1803. name: {
  1804. offsetY: 30,
  1805. fontFamily: fontFamily
  1806. },
  1807. total: {
  1808. show: true,
  1809. fontSize: '15px',
  1810. fontFamily: fontFamily,
  1811. color: legendColor,
  1812. label: 'AVG. Exceptions',
  1813. formatter: function (w) {
  1814. return '30%';
  1815. }
  1816. }
  1817. }
  1818. }
  1819. }
  1820. },
  1821. responsive: [
  1822. {
  1823. breakpoint: 1025,
  1824. options: {
  1825. chart: {
  1826. height: 380
  1827. }
  1828. }
  1829. }
  1830. ]
  1831. };
  1832. if (typeof deliveryExceptionsChartE1 !== undefined && deliveryExceptionsChartE1 !== null) {
  1833. const deliveryExceptionsChart = new ApexCharts(deliveryExceptionsChartE1, deliveryExceptionsChartConfig);
  1834. deliveryExceptionsChart.render();
  1835. }
  1836. // Shipment statistics Chart
  1837. // --------------------------------------------------------------------
  1838. const shipmentEl = document.querySelector('#shipmentStatisticsChart'),
  1839. shipmentConfig = {
  1840. series: [
  1841. {
  1842. name: 'Shipment',
  1843. type: 'column',
  1844. data: [38, 45, 33, 38, 32, 50, 48, 40, 42, 37]
  1845. },
  1846. {
  1847. name: 'Delivery',
  1848. type: 'line',
  1849. data: [23, 28, 23, 32, 28, 44, 32, 38, 26, 34]
  1850. }
  1851. ],
  1852. chart: {
  1853. height: 320,
  1854. type: 'line',
  1855. stacked: false,
  1856. parentHeightOffset: 0,
  1857. toolbar: { show: false },
  1858. zoom: { enabled: false }
  1859. },
  1860. markers: {
  1861. size: 5,
  1862. colors: [config.colors.white],
  1863. strokeColors: chartColors.line.series2,
  1864. hover: { size: 6 },
  1865. borderRadius: 4
  1866. },
  1867. stroke: {
  1868. curve: 'smooth',
  1869. width: [0, 3],
  1870. lineCap: 'round'
  1871. },
  1872. legend: {
  1873. show: true,
  1874. position: 'bottom',
  1875. markers: {
  1876. size: 4,
  1877. offsetX: -3,
  1878. strokeWidth: 0
  1879. },
  1880. height: 40,
  1881. itemMargin: {
  1882. horizontal: 10,
  1883. vertical: 0
  1884. },
  1885. fontSize: '15px',
  1886. fontFamily: fontFamily,
  1887. fontWeight: 400,
  1888. labels: {
  1889. colors: headingColor,
  1890. useSeriesColors: false
  1891. },
  1892. offsetY: 5
  1893. },
  1894. grid: {
  1895. strokeDashArray: 8,
  1896. borderColor
  1897. },
  1898. colors: [chartColors.line.series1, chartColors.line.series2],
  1899. fill: {
  1900. opacity: [1, 1]
  1901. },
  1902. plotOptions: {
  1903. bar: {
  1904. columnWidth: '30%',
  1905. startingShape: 'rounded',
  1906. endingShape: 'rounded',
  1907. borderRadius: 4
  1908. }
  1909. },
  1910. dataLabels: { enabled: false },
  1911. xaxis: {
  1912. tickAmount: 10,
  1913. categories: ['1 Jan', '2 Jan', '3 Jan', '4 Jan', '5 Jan', '6 Jan', '7 Jan', '8 Jan', '9 Jan', '10 Jan'],
  1914. labels: {
  1915. style: {
  1916. colors: labelColor,
  1917. fontSize: '13px',
  1918. fontFamily: fontFamily,
  1919. fontWeight: 400
  1920. }
  1921. },
  1922. axisBorder: { show: false },
  1923. axisTicks: { show: false }
  1924. },
  1925. yaxis: {
  1926. tickAmount: 4,
  1927. min: 0,
  1928. max: 50,
  1929. labels: {
  1930. style: {
  1931. colors: labelColor,
  1932. fontSize: '13px',
  1933. fontFamily: fontFamily,
  1934. fontWeight: 400
  1935. },
  1936. formatter: function (val) {
  1937. return val + '%';
  1938. }
  1939. }
  1940. },
  1941. responsive: [
  1942. {
  1943. breakpoint: 1400,
  1944. options: {
  1945. chart: { height: 320 },
  1946. xaxis: { labels: { style: { fontSize: '10px' } } },
  1947. legend: {
  1948. itemMargin: {
  1949. vertical: 0,
  1950. horizontal: 10
  1951. },
  1952. fontSize: '13px'
  1953. }
  1954. }
  1955. },
  1956. {
  1957. breakpoint: 1025,
  1958. options: {
  1959. chart: { height: 415 },
  1960. plotOptions: { bar: { columnWidth: '50%' } }
  1961. }
  1962. },
  1963. {
  1964. breakpoint: 982,
  1965. options: { plotOptions: { bar: { columnWidth: '30%' } } }
  1966. },
  1967. {
  1968. breakpoint: 480,
  1969. options: {
  1970. chart: { height: 250 },
  1971. legend: { offsetY: 7 }
  1972. }
  1973. }
  1974. ]
  1975. };
  1976. if (typeof shipmentEl !== undefined && shipmentEl !== null) {
  1977. const shipment = new ApexCharts(shipmentEl, shipmentConfig);
  1978. shipment.render();
  1979. }
  1980. })();