apex-custom.js 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641
  1. $(function () {
  2. "use strict";
  3. // chart 1
  4. var options = {
  5. series: [{
  6. name: 'Likes',
  7. data: [14, 3, 10, 9, 29, 19, 22, 9, 12, 7, 19, 5]
  8. }],
  9. chart: {
  10. foreColor: '#9ba7b2',
  11. height: 360,
  12. type: 'line',
  13. zoom: {
  14. enabled: false
  15. },
  16. toolbar: {
  17. show: true
  18. },
  19. dropShadow: {
  20. enabled: true,
  21. top: 3,
  22. left: 14,
  23. blur: 4,
  24. opacity: 0.10,
  25. }
  26. },
  27. stroke: {
  28. width: 5,
  29. curve: 'smooth'
  30. },
  31. xaxis: {
  32. //type: 'datetime',
  33. categories: ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'],
  34. },
  35. title: {
  36. text: 'Line Chart',
  37. align: 'left',
  38. style: {
  39. fontSize: "16px",
  40. color: '#666'
  41. }
  42. },
  43. fill: {
  44. type: 'gradient',
  45. gradient: {
  46. shade: 'light',
  47. gradientToColors: ['#3461ff'],
  48. shadeIntensity: 1,
  49. type: 'horizontal',
  50. opacityFrom: 1,
  51. opacityTo: 1,
  52. stops: [0, 100, 100, 100]
  53. },
  54. },
  55. markers: {
  56. size: 4,
  57. colors: ["#3461ff"],
  58. strokeColors: "#fff",
  59. strokeWidth: 2,
  60. hover: {
  61. size: 7,
  62. }
  63. },
  64. colors: ["#3461ff"],
  65. yaxis: {
  66. title: {
  67. text: 'Engagement',
  68. },
  69. }
  70. };
  71. var chart = new ApexCharts(document.querySelector("#chart1"), options);
  72. chart.render();
  73. // chart 2
  74. var optionsLine = {
  75. chart: {
  76. foreColor: '#9ba7b2',
  77. height: 360,
  78. type: 'line',
  79. zoom: {
  80. enabled: false
  81. },
  82. dropShadow: {
  83. enabled: true,
  84. top: 3,
  85. left: 2,
  86. blur: 4,
  87. opacity: 0.1,
  88. }
  89. },
  90. stroke: {
  91. curve: 'smooth',
  92. width: 5
  93. },
  94. colors: ["#e72e2e", '#0c971a'],
  95. series: [{
  96. name: "Music",
  97. data: [1, 15, 56, 20, 33, 27, 15, 56, 20, 56]
  98. }, {
  99. name: "Photos",
  100. data: [30, 33, 21, 42, 30, 33, 21, 42, 19, 32]
  101. }],
  102. title: {
  103. text: 'Multiline Chart',
  104. align: 'left',
  105. offsetY: 25,
  106. offsetX: 20
  107. },
  108. subtitle: {
  109. text: 'Statistics',
  110. offsetY: 55,
  111. offsetX: 20
  112. },
  113. markers: {
  114. size: 4,
  115. strokeWidth: 0,
  116. hover: {
  117. size: 7
  118. }
  119. },
  120. grid: {
  121. show: true,
  122. padding: {
  123. bottom: 0
  124. }
  125. },
  126. //labels: ['01/15/2002', '01/16/2002', '01/17/2002', '01/18/2002', '01/19/2002', '01/20/2002'],
  127. xaxis: {
  128. //type: 'datetime',
  129. categories: ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct'],
  130. },
  131. legend: {
  132. position: 'top',
  133. horizontalAlign: 'right',
  134. offsetY: -20
  135. }
  136. }
  137. var chartLine = new ApexCharts(document.querySelector('#chart2'), optionsLine);
  138. chartLine.render();
  139. // chart 3
  140. var options = {
  141. series: [{
  142. name: 'series1',
  143. data: [31, 40, 68, 31, 92, 55, 100]
  144. }, {
  145. name: 'series2',
  146. data: [11, 82, 45, 80, 34, 52, 41]
  147. }],
  148. chart: {
  149. foreColor: '#9ba7b2',
  150. height: 360,
  151. type: 'area',
  152. zoom: {
  153. enabled: false
  154. },
  155. toolbar: {
  156. show: true
  157. },
  158. },
  159. colors: ["#3461ff", '#0c971a'],
  160. title: {
  161. text: 'Area Chart',
  162. align: 'left',
  163. style: {
  164. fontSize: "16px",
  165. color: '#666'
  166. }
  167. },
  168. dataLabels: {
  169. enabled: false
  170. },
  171. stroke: {
  172. curve: 'smooth'
  173. },
  174. xaxis: {
  175. type: 'datetime',
  176. categories: ["2018-09-19T00:00:00.000Z", "2018-09-19T01:30:00.000Z", "2018-09-19T02:30:00.000Z", "2018-09-19T03:30:00.000Z", "2018-09-19T04:30:00.000Z", "2018-09-19T05:30:00.000Z", "2018-09-19T06:30:00.000Z"]
  177. },
  178. tooltip: {
  179. x: {
  180. format: 'dd/MM/yy HH:mm'
  181. },
  182. },
  183. };
  184. var chart = new ApexCharts(document.querySelector("#chart3"), options);
  185. chart.render();
  186. // chart 4
  187. var options = {
  188. series: [{
  189. name: 'Net Profit',
  190. data: [44, 55, 57, 56, 61, 58, 63, 60, 66]
  191. }, {
  192. name: 'Revenue',
  193. data: [76, 85, 101, 98, 87, 105, 91, 114, 94]
  194. }, {
  195. name: 'Free Cash Flow',
  196. data: [35, 41, 36, 26, 45, 48, 52, 53, 41]
  197. }],
  198. chart: {
  199. foreColor: '#9ba7b2',
  200. type: 'bar',
  201. height: 360
  202. },
  203. plotOptions: {
  204. bar: {
  205. horizontal: false,
  206. columnWidth: '55%',
  207. endingShape: 'rounded'
  208. },
  209. },
  210. dataLabels: {
  211. enabled: false
  212. },
  213. stroke: {
  214. show: true,
  215. width: 2,
  216. colors: ['transparent']
  217. },
  218. title: {
  219. text: 'Column Chart',
  220. align: 'left',
  221. style: {
  222. fontSize: '14px'
  223. }
  224. },
  225. colors: ["#6184ff", '#3461ff', '#c4d1ff'],
  226. xaxis: {
  227. categories: ['Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct'],
  228. },
  229. yaxis: {
  230. title: {
  231. text: '$ (thousands)'
  232. }
  233. },
  234. fill: {
  235. opacity: 1
  236. },
  237. tooltip: {
  238. y: {
  239. formatter: function (val) {
  240. return "$ " + val + " thousands"
  241. }
  242. }
  243. }
  244. };
  245. var chart = new ApexCharts(document.querySelector("#chart4"), options);
  246. chart.render();
  247. // chart 5
  248. var options = {
  249. series: [{
  250. data: [400, 430, 448, 470, 540, 580, 690, 610, 800, 980]
  251. }],
  252. chart: {
  253. foreColor: '#9ba7b2',
  254. type: 'bar',
  255. height: 350
  256. },
  257. colors: ["#f83030"],
  258. plotOptions: {
  259. bar: {
  260. horizontal: true,
  261. columnWidth: '35%',
  262. endingShape: 'rounded'
  263. }
  264. },
  265. dataLabels: {
  266. enabled: false
  267. },
  268. xaxis: {
  269. categories: ['South Korea', 'Canada', 'United Kingdom', 'Netherlands', 'Italy', 'France', 'Japan', 'United States', 'China', 'Germany'],
  270. }
  271. };
  272. var chart = new ApexCharts(document.querySelector("#chart5"), options);
  273. chart.render();
  274. // chart 6
  275. var options = {
  276. series: [{
  277. name: 'Website Blog',
  278. type: 'column',
  279. data: [440, 505, 414, 671, 227, 413, 201, 352, 752, 320, 257, 160]
  280. }, {
  281. name: 'Social Media',
  282. type: 'line',
  283. data: [23, 42, 35, 27, 43, 22, 17, 31, 22, 22, 12, 16]
  284. }],
  285. chart: {
  286. foreColor: '#9ba7b2',
  287. height: 350,
  288. type: 'line',
  289. zoom: {
  290. enabled: false
  291. },
  292. toolbar: {
  293. show: true
  294. },
  295. },
  296. stroke: {
  297. width: [0, 4]
  298. },
  299. plotOptions: {
  300. bar: {
  301. //horizontal: true,
  302. columnWidth: '35%',
  303. endingShape: 'rounded'
  304. }
  305. },
  306. colors: ["#0d6efd", "#212529"],
  307. title: {
  308. text: 'Traffic Sources'
  309. },
  310. dataLabels: {
  311. enabled: true,
  312. enabledOnSeries: [1]
  313. },
  314. labels: ['01 Jan 2001', '02 Jan 2001', '03 Jan 2001', '04 Jan 2001', '05 Jan 2001', '06 Jan 2001', '07 Jan 2001', '08 Jan 2001', '09 Jan 2001', '10 Jan 2001', '11 Jan 2001', '12 Jan 2001'],
  315. xaxis: {
  316. type: 'datetime'
  317. },
  318. yaxis: [{
  319. title: {
  320. text: 'Website Blog',
  321. },
  322. }, {
  323. opposite: true,
  324. title: {
  325. text: 'Social Media'
  326. }
  327. }]
  328. };
  329. var chart = new ApexCharts(document.querySelector("#chart6"), options);
  330. chart.render();
  331. // chart 7
  332. var options = {
  333. series: [{
  334. name: 'TEAM A',
  335. type: 'column',
  336. data: [23, 11, 22, 27, 13, 22, 37, 21, 44, 22, 30]
  337. }, {
  338. name: 'TEAM B',
  339. type: 'area',
  340. data: [44, 55, 41, 67, 22, 43, 21, 41, 56, 27, 43]
  341. }, {
  342. name: 'TEAM C',
  343. type: 'line',
  344. data: [30, 25, 36, 30, 45, 35, 64, 52, 59, 36, 39]
  345. }],
  346. chart: {
  347. foreColor: '#9ba7b2',
  348. height: 350,
  349. type: 'line',
  350. stacked: false,
  351. zoom: {
  352. enabled: false
  353. },
  354. toolbar: {
  355. show: true
  356. },
  357. },
  358. colors: ["#0d6efd", "#17a00e", "#f41127"],
  359. stroke: {
  360. width: [0, 2, 5],
  361. curve: 'smooth'
  362. },
  363. plotOptions: {
  364. bar: {
  365. columnWidth: '50%'
  366. }
  367. },
  368. fill: {
  369. opacity: [0.85, 0.25, 1],
  370. gradient: {
  371. inverseColors: false,
  372. shade: 'light',
  373. type: "vertical",
  374. opacityFrom: 0.85,
  375. opacityTo: 0.55,
  376. stops: [0, 100, 100, 100]
  377. }
  378. },
  379. 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'],
  380. markers: {
  381. size: 0
  382. },
  383. xaxis: {
  384. type: 'datetime'
  385. },
  386. yaxis: {
  387. title: {
  388. text: 'Points',
  389. },
  390. min: 0
  391. },
  392. tooltip: {
  393. shared: true,
  394. intersect: false,
  395. y: {
  396. formatter: function (y) {
  397. if (typeof y !== "undefined") {
  398. return y.toFixed(0) + " points";
  399. }
  400. return y;
  401. }
  402. }
  403. }
  404. };
  405. var chart = new ApexCharts(document.querySelector("#chart7"), options);
  406. chart.render();
  407. // chart 8
  408. var options = {
  409. series: [44, 55, 13, 43, 22],
  410. chart: {
  411. foreColor: '#9ba7b2',
  412. height: 330,
  413. type: 'pie',
  414. },
  415. colors: ["#0d6efd", "#6c757d", "#17a00e", "#f41127", "#ffc107"],
  416. labels: ['Team A', 'Team B', 'Team C', 'Team D', 'Team E'],
  417. responsive: [{
  418. breakpoint: 480,
  419. options: {
  420. chart: {
  421. height: 360
  422. },
  423. legend: {
  424. position: 'bottom'
  425. }
  426. }
  427. }]
  428. };
  429. var chart = new ApexCharts(document.querySelector("#chart8"), options);
  430. chart.render();
  431. // chart 9
  432. var options = {
  433. series: [44, 55, 41, 17, 15],
  434. chart: {
  435. foreColor: '#9ba7b2',
  436. height: 380,
  437. type: 'donut',
  438. },
  439. colors: ["#0d6efd", "#212529", "#17a00e", "#f41127", "#ffc107"],
  440. responsive: [{
  441. breakpoint: 480,
  442. options: {
  443. chart: {
  444. height: 320
  445. },
  446. legend: {
  447. position: 'bottom'
  448. }
  449. }
  450. }]
  451. };
  452. var chart = new ApexCharts(document.querySelector("#chart9"), options);
  453. chart.render();
  454. // chart 10
  455. var options = {
  456. series: [{
  457. name: 'Series 1',
  458. data: [80, 50, 30, 40, 100, 20],
  459. }, {
  460. name: 'Series 2',
  461. data: [20, 30, 40, 80, 20, 80],
  462. }, {
  463. name: 'Series 3',
  464. data: [44, 76, 78, 13, 43, 10],
  465. }],
  466. chart: {
  467. foreColor: '#9ba7b2',
  468. height: 350,
  469. type: 'radar',
  470. dropShadow: {
  471. enabled: true,
  472. blur: 1,
  473. left: 1,
  474. top: 1
  475. }
  476. },
  477. colors: ["#0d6efd", "#212529", "#17a00e"],
  478. title: {
  479. text: 'Radar Chart - Multi Series'
  480. },
  481. stroke: {
  482. width: 2
  483. },
  484. fill: {
  485. opacity: 0.1
  486. },
  487. markers: {
  488. size: 0
  489. },
  490. xaxis: {
  491. categories: ['2011', '2012', '2013', '2014', '2015', '2016']
  492. }
  493. };
  494. var chart = new ApexCharts(document.querySelector("#chart10"), options);
  495. chart.render();
  496. // chart 11
  497. var options = {
  498. series: [{
  499. name: 'Series 1',
  500. data: [20, 100, 40, 30, 50, 80, 33],
  501. }],
  502. chart: {
  503. foreColor: '#9ba7b2',
  504. height: 350,
  505. type: 'radar',
  506. },
  507. dataLabels: {
  508. enabled: true
  509. },
  510. plotOptions: {
  511. radar: {
  512. size: 140,
  513. polygons: {
  514. strokeColors: '#e9e9e9',
  515. fill: {
  516. colors: ['#f8f8f8', '#fff']
  517. }
  518. }
  519. }
  520. },
  521. title: {
  522. text: 'Radar with Polygon Fill'
  523. },
  524. colors: ["#0d6efd"],
  525. markers: {
  526. size: 4,
  527. colors: ['#fff'],
  528. strokeColor: '#FF4560',
  529. strokeWidth: 2,
  530. },
  531. tooltip: {
  532. y: {
  533. formatter: function (val) {
  534. return val
  535. }
  536. }
  537. },
  538. xaxis: {
  539. categories: ['Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday']
  540. },
  541. yaxis: {
  542. tickAmount: 7,
  543. labels: {
  544. formatter: function (val, i) {
  545. if (i % 2 === 0) {
  546. return val
  547. } else {
  548. return ''
  549. }
  550. }
  551. }
  552. }
  553. };
  554. var chart = new ApexCharts(document.querySelector("#chart11"), options);
  555. chart.render();
  556. // chart 12
  557. var options = {
  558. series: [70],
  559. chart: {
  560. foreColor: '#9ba7b2',
  561. height: 350,
  562. type: 'radialBar',
  563. },
  564. plotOptions: {
  565. radialBar: {
  566. hollow: {
  567. size: '70%',
  568. }
  569. },
  570. },
  571. labels: ['Cricket'],
  572. };
  573. var chart = new ApexCharts(document.querySelector("#chart12"), options);
  574. chart.render();
  575. // chart 13
  576. var options = {
  577. series: [44, 55, 67, 83],
  578. chart: {
  579. foreColor: '#9ba7b2',
  580. height: 350,
  581. type: 'radialBar',
  582. },
  583. plotOptions: {
  584. radialBar: {
  585. dataLabels: {
  586. name: {
  587. fontSize: '22px',
  588. },
  589. value: {
  590. fontSize: '16px',
  591. },
  592. total: {
  593. show: true,
  594. label: 'Total',
  595. formatter: function (w) {
  596. // By default this function returns the average of all series. The below is just an example to show the use of custom formatter function
  597. return 249
  598. }
  599. }
  600. }
  601. }
  602. },
  603. colors: ["#0d6efd", "#17a00e", "#f41127", "#ffc107"],
  604. labels: ['Apples', 'Oranges', 'Bananas', 'Berries'],
  605. };
  606. var chart = new ApexCharts(document.querySelector("#chart13"), options);
  607. chart.render();
  608. });