chart-apex.js 22 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009
  1. /*=========================================================================================
  2. File Name: chart-apex.js
  3. Description: 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. $(document).ready(function () {
  10. var $primary = '#7367F0',
  11. $success = '#28C76F',
  12. $danger = '#EA5455',
  13. $warning = '#FF9F43',
  14. $info = '#00cfe8',
  15. $label_color_light = '#dae1e7';
  16. var themeColors = [$primary, $success, $danger, $warning, $info];
  17. // RTL Support
  18. var yaxis_opposite = false;
  19. if($('html').data('textdirection') == 'rtl'){
  20. yaxis_opposite = true;
  21. }
  22. // Line Chart
  23. // ----------------------------------
  24. var lineChartOptions = {
  25. chart: {
  26. height: 350,
  27. type: 'line',
  28. zoom: {
  29. enabled: false
  30. }
  31. },
  32. colors: themeColors,
  33. dataLabels: {
  34. enabled: false
  35. },
  36. stroke: {
  37. curve: 'straight'
  38. },
  39. series: [{
  40. name: "Desktops",
  41. data: [10, 41, 35, 51, 49, 62, 69, 91, 148],
  42. }],
  43. title: {
  44. text: 'Product Trends by Month',
  45. align: 'left'
  46. },
  47. grid: {
  48. row: {
  49. colors: ['#f3f3f3', 'transparent'], // takes an array which will be repeated on columns
  50. opacity: 0.5
  51. },
  52. },
  53. xaxis: {
  54. categories: ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep'],
  55. },
  56. yaxis: {
  57. tickAmount: 5,
  58. opposite: yaxis_opposite
  59. }
  60. }
  61. var lineChart = new ApexCharts(
  62. document.querySelector("#line-chart"),
  63. lineChartOptions
  64. );
  65. lineChart.render();
  66. // Line Area Chart
  67. // ----------------------------------
  68. var lineAreaOptions = {
  69. chart: {
  70. height: 350,
  71. type: 'area',
  72. },
  73. colors: themeColors,
  74. dataLabels: {
  75. enabled: false
  76. },
  77. stroke: {
  78. curve: 'smooth'
  79. },
  80. series: [{
  81. name: 'series1',
  82. data: [31, 40, 28, 51, 42, 109, 100]
  83. }, {
  84. name: 'series2',
  85. data: [11, 32, 45, 32, 34, 52, 41]
  86. }],
  87. legend: {
  88. offsetY: -10
  89. },
  90. xaxis: {
  91. type: 'datetime',
  92. categories: ["2019-09-18T00:00:00", "2019-09-18T01:00:00", "2019-09-18T02:00:00",
  93. "2019-09-18T03:00:00", "2019-09-18T04:00:00", "2019-09-18T05:00:00",
  94. "2019-09-18T06:00:00"
  95. ],
  96. },
  97. yaxis: {
  98. opposite: yaxis_opposite
  99. },
  100. tooltip: {
  101. x: {
  102. format: 'dd/MM/yy HH:mm'
  103. },
  104. }
  105. }
  106. var lineAreaChart = new ApexCharts(
  107. document.querySelector("#line-area-chart"),
  108. lineAreaOptions
  109. );
  110. lineAreaChart.render();
  111. // Column Chart
  112. // ----------------------------------
  113. var columnChartOptions = {
  114. chart: {
  115. height: 350,
  116. type: 'bar',
  117. },
  118. colors: themeColors,
  119. plotOptions: {
  120. bar: {
  121. horizontal: false,
  122. endingShape: 'rounded',
  123. columnWidth: '55%',
  124. },
  125. },
  126. dataLabels: {
  127. enabled: false
  128. },
  129. stroke: {
  130. show: true,
  131. width: 2,
  132. colors: ['transparent']
  133. },
  134. series: [{
  135. name: 'Net Profit',
  136. data: [44, 55, 57, 56, 61, 58, 63, 60, 66]
  137. }, {
  138. name: 'Revenue',
  139. data: [76, 85, 101, 98, 87, 105, 91, 114, 94]
  140. }, {
  141. name: 'Free Cash Flow',
  142. data: [35, 41, 36, 26, 45, 48, 52, 53, 41]
  143. }],
  144. legend: {
  145. offsetY: -10
  146. },
  147. xaxis: {
  148. categories: ['Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct'],
  149. },
  150. yaxis: {
  151. title: {
  152. text: '$ (thousands)'
  153. },
  154. opposite: yaxis_opposite
  155. },
  156. fill: {
  157. opacity: 1
  158. },
  159. tooltip: {
  160. y: {
  161. formatter: function (val) {
  162. return "$ " + val + " thousands"
  163. }
  164. }
  165. }
  166. }
  167. var columnChart = new ApexCharts(
  168. document.querySelector("#column-chart"),
  169. columnChartOptions
  170. );
  171. columnChart.render();
  172. // Bar Chart
  173. // ----------------------------------
  174. var barChartOptions = {
  175. chart: {
  176. height: 350,
  177. type: 'bar',
  178. },
  179. colors: themeColors,
  180. plotOptions: {
  181. bar: {
  182. horizontal: true,
  183. }
  184. },
  185. dataLabels: {
  186. enabled: false
  187. },
  188. series: [{
  189. data: [400, 430, 448, 470, 540, 580, 690, 1100, 1200, 1380]
  190. }],
  191. xaxis: {
  192. categories: ['South Korea', 'Canada', 'United Kingdom', 'Netherlands', 'Italy', 'France', 'Japan', 'United States', 'China', 'Germany'],
  193. tickAmount: 5
  194. },
  195. yaxis: {
  196. opposite: yaxis_opposite
  197. }
  198. }
  199. var barChart = new ApexCharts(
  200. document.querySelector("#bar-chart"),
  201. barChartOptions
  202. );
  203. barChart.render();
  204. // Mixed Chart
  205. // -----------------------------
  206. var mixedChartOptions = {
  207. chart: {
  208. height: 350,
  209. type: 'line',
  210. stacked: false,
  211. },
  212. colors: themeColors,
  213. stroke: {
  214. width: [0, 2, 5],
  215. curve: 'smooth'
  216. },
  217. plotOptions: {
  218. bar: {
  219. columnWidth: '50%'
  220. }
  221. },
  222. // colors: ['#3A5794', '#A5C351', '#E14A84'],
  223. series: [{
  224. name: 'TEAM A',
  225. type: 'column',
  226. data: [23, 11, 22, 27, 13, 22, 37, 21, 44, 22, 30]
  227. }, {
  228. name: 'TEAM B',
  229. type: 'area',
  230. data: [44, 55, 41, 67, 22, 43, 21, 41, 56, 27, 43]
  231. }, {
  232. name: 'TEAM C',
  233. type: 'line',
  234. data: [30, 25, 36, 30, 45, 35, 64, 52, 59, 36, 39]
  235. }],
  236. fill: {
  237. opacity: [0.85, 0.25, 1],
  238. gradient: {
  239. inverseColors: false,
  240. shade: 'light',
  241. type: "vertical",
  242. opacityFrom: 0.85,
  243. opacityTo: 0.55,
  244. stops: [0, 100, 100, 100]
  245. }
  246. },
  247. labels: ['01/01/2003', '02/01/2003', '03/01/2003', '04/01/2003', '05/01/2003', '06/01/2003', '07/01/2003', '08/01/2003', '09/01/2003', '10/01/2003', '11/01/2003'],
  248. markers: {
  249. size: 0
  250. },
  251. legend: {
  252. offsetY: -10
  253. },
  254. xaxis: {
  255. type: 'datetime'
  256. },
  257. yaxis: {
  258. min: 0,
  259. tickAmount: 5,
  260. title: {
  261. text: 'Points'
  262. },
  263. opposite: yaxis_opposite
  264. },
  265. tooltip: {
  266. shared: true,
  267. intersect: false,
  268. y: {
  269. formatter: function (y) {
  270. if (typeof y !== "undefined") {
  271. return y.toFixed(0) + " views";
  272. }
  273. return y;
  274. }
  275. }
  276. }
  277. }
  278. var mixedChart = new ApexCharts(
  279. document.querySelector("#mixed-chart"),
  280. mixedChartOptions
  281. );
  282. mixedChart.render();
  283. // Candlestick Chart
  284. // -----------------------------
  285. var candleStickOptions = {
  286. chart: {
  287. height: 350,
  288. type: 'candlestick',
  289. },
  290. colors: themeColors,
  291. series: [{
  292. data: [{
  293. x: new Date(1538778600000),
  294. y: [6629.81, 6650.5, 6623.04, 6633.33]
  295. },
  296. {
  297. x: new Date(1538780400000),
  298. y: [6632.01, 6643.59, 6620, 6630.11]
  299. },
  300. {
  301. x: new Date(1538782200000),
  302. y: [6630.71, 6648.95, 6623.34, 6635.65]
  303. },
  304. {
  305. x: new Date(1538784000000),
  306. y: [6635.65, 6651, 6629.67, 6638.24]
  307. },
  308. {
  309. x: new Date(1538785800000),
  310. y: [6638.24, 6640, 6620, 6624.47]
  311. },
  312. {
  313. x: new Date(1538787600000),
  314. y: [6624.53, 6636.03, 6621.68, 6624.31]
  315. },
  316. {
  317. x: new Date(1538789400000),
  318. y: [6624.61, 6632.2, 6617, 6626.02]
  319. },
  320. {
  321. x: new Date(1538791200000),
  322. y: [6627, 6627.62, 6584.22, 6603.02]
  323. },
  324. {
  325. x: new Date(1538793000000),
  326. y: [6605, 6608.03, 6598.95, 6604.01]
  327. },
  328. {
  329. x: new Date(1538794800000),
  330. y: [6604.5, 6614.4, 6602.26, 6608.02]
  331. },
  332. {
  333. x: new Date(1538796600000),
  334. y: [6608.02, 6610.68, 6601.99, 6608.91]
  335. },
  336. {
  337. x: new Date(1538798400000),
  338. y: [6608.91, 6618.99, 6608.01, 6612]
  339. },
  340. {
  341. x: new Date(1538800200000),
  342. y: [6612, 6615.13, 6605.09, 6612]
  343. },
  344. {
  345. x: new Date(1538802000000),
  346. y: [6612, 6624.12, 6608.43, 6622.95]
  347. },
  348. {
  349. x: new Date(1538803800000),
  350. y: [6623.91, 6623.91, 6615, 6615.67]
  351. },
  352. {
  353. x: new Date(1538805600000),
  354. y: [6618.69, 6618.74, 6610, 6610.4]
  355. },
  356. {
  357. x: new Date(1538807400000),
  358. y: [6611, 6622.78, 6610.4, 6614.9]
  359. },
  360. {
  361. x: new Date(1538809200000),
  362. y: [6614.9, 6626.2, 6613.33, 6623.45]
  363. },
  364. {
  365. x: new Date(1538811000000),
  366. y: [6623.48, 6627, 6618.38, 6620.35]
  367. },
  368. {
  369. x: new Date(1538812800000),
  370. y: [6619.43, 6620.35, 6610.05, 6615.53]
  371. },
  372. {
  373. x: new Date(1538814600000),
  374. y: [6615.53, 6617.93, 6610, 6615.19]
  375. },
  376. {
  377. x: new Date(1538816400000),
  378. y: [6615.19, 6621.6, 6608.2, 6620]
  379. },
  380. {
  381. x: new Date(1538818200000),
  382. y: [6619.54, 6625.17, 6614.15, 6620]
  383. },
  384. {
  385. x: new Date(1538820000000),
  386. y: [6620.33, 6634.15, 6617.24, 6624.61]
  387. },
  388. {
  389. x: new Date(1538821800000),
  390. y: [6625.95, 6626, 6611.66, 6617.58]
  391. },
  392. {
  393. x: new Date(1538823600000),
  394. y: [6619, 6625.97, 6595.27, 6598.86]
  395. },
  396. {
  397. x: new Date(1538825400000),
  398. y: [6598.86, 6598.88, 6570, 6587.16]
  399. },
  400. {
  401. x: new Date(1538827200000),
  402. y: [6588.86, 6600, 6580, 6593.4]
  403. },
  404. {
  405. x: new Date(1538829000000),
  406. y: [6593.99, 6598.89, 6585, 6587.81]
  407. },
  408. {
  409. x: new Date(1538830800000),
  410. y: [6587.81, 6592.73, 6567.14, 6578]
  411. },
  412. {
  413. x: new Date(1538832600000),
  414. y: [6578.35, 6581.72, 6567.39, 6579]
  415. },
  416. {
  417. x: new Date(1538834400000),
  418. y: [6579.38, 6580.92, 6566.77, 6575.96]
  419. },
  420. {
  421. x: new Date(1538836200000),
  422. y: [6575.96, 6589, 6571.77, 6588.92]
  423. },
  424. {
  425. x: new Date(1538838000000),
  426. y: [6588.92, 6594, 6577.55, 6589.22]
  427. },
  428. {
  429. x: new Date(1538839800000),
  430. y: [6589.3, 6598.89, 6589.1, 6596.08]
  431. },
  432. {
  433. x: new Date(1538841600000),
  434. y: [6597.5, 6600, 6588.39, 6596.25]
  435. },
  436. {
  437. x: new Date(1538843400000),
  438. y: [6598.03, 6600, 6588.73, 6595.97]
  439. },
  440. {
  441. x: new Date(1538845200000),
  442. y: [6595.97, 6602.01, 6588.17, 6602]
  443. },
  444. {
  445. x: new Date(1538847000000),
  446. y: [6602, 6607, 6596.51, 6599.95]
  447. },
  448. {
  449. x: new Date(1538848800000),
  450. y: [6600.63, 6601.21, 6590.39, 6591.02]
  451. },
  452. {
  453. x: new Date(1538850600000),
  454. y: [6591.02, 6603.08, 6591, 6591]
  455. },
  456. {
  457. x: new Date(1538852400000),
  458. y: [6591, 6601.32, 6585, 6592]
  459. },
  460. {
  461. x: new Date(1538854200000),
  462. y: [6593.13, 6596.01, 6590, 6593.34]
  463. },
  464. {
  465. x: new Date(1538856000000),
  466. y: [6593.34, 6604.76, 6582.63, 6593.86]
  467. },
  468. {
  469. x: new Date(1538857800000),
  470. y: [6593.86, 6604.28, 6586.57, 6600.01]
  471. },
  472. {
  473. x: new Date(1538859600000),
  474. y: [6601.81, 6603.21, 6592.78, 6596.25]
  475. },
  476. {
  477. x: new Date(1538861400000),
  478. y: [6596.25, 6604.2, 6590, 6602.99]
  479. },
  480. {
  481. x: new Date(1538863200000),
  482. y: [6602.99, 6606, 6584.99, 6587.81]
  483. },
  484. {
  485. x: new Date(1538865000000),
  486. y: [6587.81, 6595, 6583.27, 6591.96]
  487. },
  488. {
  489. x: new Date(1538866800000),
  490. y: [6591.97, 6596.07, 6585, 6588.39]
  491. },
  492. {
  493. x: new Date(1538868600000),
  494. y: [6587.6, 6598.21, 6587.6, 6594.27]
  495. },
  496. {
  497. x: new Date(1538870400000),
  498. y: [6596.44, 6601, 6590, 6596.55]
  499. },
  500. {
  501. x: new Date(1538872200000),
  502. y: [6598.91, 6605, 6596.61, 6600.02]
  503. },
  504. {
  505. x: new Date(1538874000000),
  506. y: [6600.55, 6605, 6589.14, 6593.01]
  507. },
  508. {
  509. x: new Date(1538875800000),
  510. y: [6593.15, 6605, 6592, 6603.06]
  511. },
  512. {
  513. x: new Date(1538877600000),
  514. y: [6603.07, 6604.5, 6599.09, 6603.89]
  515. },
  516. {
  517. x: new Date(1538879400000),
  518. y: [6604.44, 6604.44, 6600, 6603.5]
  519. },
  520. {
  521. x: new Date(1538881200000),
  522. y: [6603.5, 6603.99, 6597.5, 6603.86]
  523. },
  524. {
  525. x: new Date(1538883000000),
  526. y: [6603.85, 6605, 6600, 6604.07]
  527. },
  528. {
  529. x: new Date(1538884800000),
  530. y: [6604.98, 6606, 6604.07, 6606]
  531. },
  532. ]
  533. }],
  534. xaxis: {
  535. type: 'datetime'
  536. },
  537. yaxis: {
  538. tickAmount: 5,
  539. tooltip: {
  540. enabled: true
  541. },
  542. opposite: yaxis_opposite
  543. }
  544. }
  545. var candleStickChart = new ApexCharts(
  546. document.querySelector("#candlestick-chart"),
  547. candleStickOptions
  548. );
  549. candleStickChart.render();
  550. // 3D Bubble Chart
  551. // -----------------------------
  552. function generateDataBubbleChart(baseval, count, yrange) {
  553. var i = 0;
  554. var seriesBubbleChart = [];
  555. while (i < count) {
  556. // var x = Math.floor(Math.random() * (750 - 1 + 1)) + 1;
  557. var y = Math.floor(Math.random() * (yrange.max - yrange.min + 1)) + yrange.min;
  558. var z = Math.floor(Math.random() * (75 - 15 + 1)) + 15;
  559. seriesBubbleChart.push([baseval, y, z]);
  560. baseval += 86400000;
  561. i++;
  562. }
  563. return seriesBubbleChart;
  564. }
  565. var bubbleChartOptions = {
  566. chart: {
  567. height: 350,
  568. type: 'bubble',
  569. },
  570. colors: themeColors,
  571. dataLabels: {
  572. enabled: false
  573. },
  574. legend: {
  575. offsetY: -10
  576. },
  577. series: [{
  578. name: 'Product1',
  579. data: generateDataBubbleChart(new Date('11 Feb 2017 GMT').getTime(), 20, {
  580. min: 10,
  581. max: 60
  582. })
  583. },
  584. {
  585. name: 'Product2',
  586. data: generateDataBubbleChart(new Date('11 Feb 2017 GMT').getTime(), 20, {
  587. min: 10,
  588. max: 60
  589. })
  590. },
  591. {
  592. name: 'Product3',
  593. data: generateDataBubbleChart(new Date('11 Feb 2017 GMT').getTime(), 20, {
  594. min: 10,
  595. max: 60
  596. })
  597. },
  598. {
  599. name: 'Product4',
  600. data: generateDataBubbleChart(new Date('11 Feb 2017 GMT').getTime(), 20, {
  601. min: 10,
  602. max: 60
  603. })
  604. }
  605. ],
  606. fill: {
  607. type: 'gradient',
  608. },
  609. xaxis: {
  610. tickAmount: 12,
  611. type: 'datetime',
  612. labels: {
  613. rotate: 0,
  614. }
  615. },
  616. yaxis: {
  617. max: 70,
  618. tickAmount: 5,
  619. opposite: yaxis_opposite
  620. },
  621. theme: {
  622. palette: 'palette2'
  623. }
  624. }
  625. var bubbleChart = new ApexCharts(
  626. document.querySelector("#bubble-chart"),
  627. bubbleChartOptions
  628. );
  629. bubbleChart.render();
  630. // Scatter Chart
  631. // -----------------------------
  632. var scatterChartOptions = {
  633. chart: {
  634. height: 350,
  635. type: 'scatter',
  636. zoom: {
  637. enabled: true,
  638. type: 'xy'
  639. },
  640. },
  641. colors: themeColors,
  642. series: [{
  643. name: "SAMPLE A",
  644. data: [
  645. [16.4, 5.4],
  646. [21.7, 2],
  647. [25.4, 3],
  648. [19, 2],
  649. [10.9, 1],
  650. [13.6, 3.2],
  651. [10.9, 7.4],
  652. [10.9, 0],
  653. [10.9, 8.2],
  654. [16.4, 0],
  655. [16.4, 1.8],
  656. [13.6, 0.3],
  657. [13.6, 0],
  658. [29.9, 0],
  659. [27.1, 2.3],
  660. [16.4, 0],
  661. [13.6, 3.7],
  662. [10.9, 5.2],
  663. [16.4, 6.5],
  664. [10.9, 0],
  665. [24.5, 7.1],
  666. [10.9, 0],
  667. [8.1, 4.7],
  668. [19, 0],
  669. [21.7, 1.8],
  670. [27.1, 0],
  671. [24.5, 0],
  672. [27.1, 0],
  673. [29.9, 1.5],
  674. [27.1, 0.8],
  675. [22.1, 2]
  676. ]
  677. }, {
  678. name: "SAMPLE B",
  679. data: [
  680. [6.4, 13.4],
  681. [1.7, 11],
  682. [5.4, 8],
  683. [9, 17],
  684. [1.9, 4],
  685. [3.6, 12.2],
  686. [1.9, 14.4],
  687. [1.9, 9],
  688. [1.9, 13.2],
  689. [1.4, 7],
  690. [6.4, 8.8],
  691. [3.6, 4.3],
  692. [1.6, 10],
  693. [9.9, 2],
  694. [7.1, 15],
  695. [1.4, 0],
  696. [3.6, 13.7],
  697. [1.9, 15.2],
  698. [6.4, 16.5],
  699. [0.9, 10],
  700. [4.5, 17.1],
  701. [10.9, 10],
  702. [0.1, 14.7],
  703. [9, 10],
  704. [12.7, 11.8],
  705. [2.1, 10],
  706. [2.5, 10],
  707. [27.1, 10],
  708. [2.9, 11.5],
  709. [7.1, 10.8],
  710. [2.1, 12]
  711. ]
  712. }, {
  713. name: "SAMPLE C",
  714. data: [
  715. [21.7, 3],
  716. [23.6, 3.5],
  717. [24.6, 3],
  718. [29.9, 3],
  719. [21.7, 20],
  720. [23, 2],
  721. [10.9, 3],
  722. [28, 4],
  723. [27.1, 0.3],
  724. [16.4, 4],
  725. [13.6, 0],
  726. [19, 5],
  727. [22.4, 3],
  728. [24.5, 3],
  729. [32.6, 3],
  730. [27.1, 4],
  731. [29.6, 6],
  732. [31.6, 8],
  733. [21.6, 5],
  734. [20.9, 4],
  735. [22.4, 0],
  736. [32.6, 10.3],
  737. [29.7, 20.8],
  738. [24.5, 0.8],
  739. [21.4, 0],
  740. [21.7, 6.9],
  741. [28.6, 7.7],
  742. [15.4, 0],
  743. [18.1, 0],
  744. [33.4, 0],
  745. [16.4, 0]
  746. ]
  747. }],
  748. legend: {
  749. offsetY: -10
  750. },
  751. xaxis: {
  752. tickAmount: 10
  753. },
  754. yaxis: {
  755. tickAmount: 7,
  756. opposite: yaxis_opposite
  757. }
  758. }
  759. var scatterChart = new ApexCharts(
  760. document.querySelector("#scatter-chart"),
  761. scatterChartOptions
  762. );
  763. scatterChart.render();
  764. // Pie Chart
  765. // -----------------------------
  766. var pieChartOptions = {
  767. chart: {
  768. type: 'pie',
  769. height: 350
  770. },
  771. colors: themeColors,
  772. labels: ['Team A', 'Team B', 'Team C', 'Team D'],
  773. series: [44, 55, 13, 43],
  774. legend: {
  775. itemMargin: {
  776. horizontal: 2
  777. },
  778. },
  779. responsive: [{
  780. breakpoint: 480,
  781. options: {
  782. chart: {
  783. width: 350
  784. },
  785. legend: {
  786. position: 'bottom'
  787. }
  788. }
  789. }]
  790. }
  791. var pieChart = new ApexCharts(
  792. document.querySelector("#pie-chart"),
  793. pieChartOptions
  794. );
  795. pieChart.render();
  796. // Donut Chart
  797. // -----------------------------
  798. var donutChartOptions = {
  799. chart: {
  800. type: 'donut',
  801. height: 350
  802. },
  803. colors: themeColors,
  804. series: [44, 55, 41, 17],
  805. legend: {
  806. itemMargin: {
  807. horizontal: 2
  808. },
  809. },
  810. responsive: [{
  811. breakpoint: 480,
  812. options: {
  813. chart: {
  814. width: 350
  815. },
  816. legend: {
  817. position: 'bottom'
  818. }
  819. }
  820. }]
  821. }
  822. var donutChart = new ApexCharts(
  823. document.querySelector("#donut-chart"),
  824. donutChartOptions
  825. );
  826. donutChart.render();
  827. // Radial Bar Chart
  828. // -----------------------------
  829. var radialBarChartOptions = {
  830. chart: {
  831. height: 350,
  832. type: 'radialBar',
  833. },
  834. colors: themeColors,
  835. plotOptions: {
  836. radialBar: {
  837. dataLabels: {
  838. name: {
  839. fontSize: '22px',
  840. },
  841. value: {
  842. fontSize: '16px',
  843. },
  844. total: {
  845. show: true,
  846. label: 'Total',
  847. // color: $label_color,
  848. formatter: function (w) {
  849. // By default this function returns the average of all series. The below is just an example to show the use of custom formatter function
  850. return 249
  851. }
  852. }
  853. }
  854. }
  855. },
  856. series: [44, 55, 67, 83],
  857. labels: ['Apples', 'Oranges', 'Bananas', 'Berries'],
  858. }
  859. var radialBarChart = new ApexCharts(
  860. document.querySelector("#radial-bar-chart"),
  861. radialBarChartOptions
  862. );
  863. radialBarChart.render();
  864. // Radar Chart
  865. // -----------------------------
  866. var radarChartOptions = {
  867. chart: {
  868. height: 350,
  869. type: 'radar',
  870. },
  871. colors: themeColors,
  872. series: [{
  873. name: 'Series 1',
  874. data: [80, 50, 30, 40, 100, 20],
  875. }],
  876. labels: ['January', 'February', 'March', 'April', 'May', 'June'],
  877. dataLabels: {
  878. style: {
  879. color: $label_color_light
  880. }
  881. }
  882. }
  883. var radarChart = new ApexCharts(document.querySelector("#radar-chart"), radarChartOptions);
  884. radarChart.render();
  885. // Heat Map Chart
  886. // -----------------------------
  887. function generateData(count, yrange) {
  888. var i = 0,
  889. series = [];
  890. while (i < count) {
  891. var x = 'w' + (i + 1).toString(),
  892. y = Math.floor(Math.random() * (yrange.max - yrange.min + 1)) + yrange.min;
  893. series.push({
  894. x: x,
  895. y: y
  896. });
  897. i++;
  898. }
  899. return series;
  900. }
  901. var heatChartOptions = {
  902. chart: {
  903. height: 350,
  904. type: 'heatmap',
  905. },
  906. dataLabels: {
  907. enabled: false
  908. },
  909. colors: [$primary],
  910. series: [{
  911. name: 'Metric1',
  912. data: generateData(18, {
  913. min: 0,
  914. max: 90
  915. })
  916. },
  917. {
  918. name: 'Metric2',
  919. data: generateData(18, {
  920. min: 0,
  921. max: 90
  922. })
  923. },
  924. {
  925. name: 'Metric3',
  926. data: generateData(18, {
  927. min: 0,
  928. max: 90
  929. })
  930. },
  931. {
  932. name: 'Metric4',
  933. data: generateData(18, {
  934. min: 0,
  935. max: 90
  936. })
  937. },
  938. {
  939. name: 'Metric5',
  940. data: generateData(18, {
  941. min: 0,
  942. max: 90
  943. })
  944. },
  945. {
  946. name: 'Metric6',
  947. data: generateData(18, {
  948. min: 0,
  949. max: 90
  950. })
  951. },
  952. {
  953. name: 'Metric7',
  954. data: generateData(18, {
  955. min: 0,
  956. max: 90
  957. })
  958. },
  959. {
  960. name: 'Metric8',
  961. data: generateData(18, {
  962. min: 0,
  963. max: 90
  964. })
  965. },
  966. {
  967. name: 'Metric9',
  968. data: generateData(18, {
  969. min: 0,
  970. max: 90
  971. })
  972. }
  973. ],
  974. yaxis: {
  975. opposite: yaxis_opposite
  976. }
  977. }
  978. var heatChart = new ApexCharts(
  979. document.querySelector("#heat-map-chart"),
  980. heatChartOptions);
  981. heatChart.render();
  982. });