demo.js 6.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288
  1. "use strict";
  2. // Cicle Chart
  3. Circles.create({
  4. id: 'task-complete',
  5. radius: 50,
  6. value: 80,
  7. maxValue: 100,
  8. width: 5,
  9. text: function(value){return value + '%';},
  10. colors: ['#36a3f7', '#fff'],
  11. duration: 400,
  12. wrpClass: 'circles-wrp',
  13. textClass: 'circles-text',
  14. styleWrapper: true,
  15. styleText: true
  16. })
  17. //Notify
  18. $.notify({
  19. icon: 'flaticon-alarm-1',
  20. title: 'Atlantis Lite',
  21. message: 'Free Bootstrap 4 Admin Dashboard',
  22. },{
  23. type: 'info',
  24. placement: {
  25. from: "bottom",
  26. align: "right"
  27. },
  28. time: 1000,
  29. });
  30. // JQVmap
  31. $('#map-example').vectorMap(
  32. {
  33. map: 'world_en',
  34. backgroundColor: 'transparent',
  35. borderColor: '#fff',
  36. borderWidth: 2,
  37. color: '#e4e4e4',
  38. enableZoom: true,
  39. hoverColor: '#35cd3a',
  40. hoverOpacity: null,
  41. normalizeFunction: 'linear',
  42. scaleColors: ['#b6d6ff', '#005ace'],
  43. selectedColor: '#35cd3a',
  44. selectedRegions: ['ID', 'RU', 'US', 'AU', 'CN', 'BR'],
  45. showTooltip: true,
  46. onRegionClick: function(element, code, region)
  47. {
  48. return false;
  49. }
  50. });
  51. //Chart
  52. var ctx = document.getElementById('statisticsChart').getContext('2d');
  53. var statisticsChart = new Chart(ctx, {
  54. type: 'line',
  55. data: {
  56. labels: ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"],
  57. datasets: [ {
  58. label: "Subscribers",
  59. borderColor: '#f3545d',
  60. pointBackgroundColor: 'rgba(243, 84, 93, 0.6)',
  61. pointRadius: 0,
  62. backgroundColor: 'rgba(243, 84, 93, 0.4)',
  63. legendColor: '#f3545d',
  64. fill: true,
  65. borderWidth: 2,
  66. data: [154, 184, 175, 203, 210, 231, 240, 278, 252, 312, 320, 374]
  67. }, {
  68. label: "New Visitors",
  69. borderColor: '#fdaf4b',
  70. pointBackgroundColor: 'rgba(253, 175, 75, 0.6)',
  71. pointRadius: 0,
  72. backgroundColor: 'rgba(253, 175, 75, 0.4)',
  73. legendColor: '#fdaf4b',
  74. fill: true,
  75. borderWidth: 2,
  76. data: [256, 230, 245, 287, 240, 250, 230, 295, 331, 431, 456, 521]
  77. }, {
  78. label: "Active Users",
  79. borderColor: '#177dff',
  80. pointBackgroundColor: 'rgba(23, 125, 255, 0.6)',
  81. pointRadius: 0,
  82. backgroundColor: 'rgba(23, 125, 255, 0.4)',
  83. legendColor: '#177dff',
  84. fill: true,
  85. borderWidth: 2,
  86. data: [542, 480, 430, 550, 530, 453, 380, 434, 568, 610, 700, 900]
  87. }]
  88. },
  89. options : {
  90. responsive: true,
  91. maintainAspectRatio: false,
  92. legend: {
  93. display: false
  94. },
  95. tooltips: {
  96. bodySpacing: 4,
  97. mode:"nearest",
  98. intersect: 0,
  99. position:"nearest",
  100. xPadding:10,
  101. yPadding:10,
  102. caretPadding:10
  103. },
  104. layout:{
  105. padding:{left:5,right:5,top:15,bottom:15}
  106. },
  107. scales: {
  108. yAxes: [{
  109. ticks: {
  110. fontStyle: "500",
  111. beginAtZero: false,
  112. maxTicksLimit: 5,
  113. padding: 10
  114. },
  115. gridLines: {
  116. drawTicks: false,
  117. display: false
  118. }
  119. }],
  120. xAxes: [{
  121. gridLines: {
  122. zeroLineColor: "transparent"
  123. },
  124. ticks: {
  125. padding: 10,
  126. fontStyle: "500"
  127. }
  128. }]
  129. },
  130. legendCallback: function(chart) {
  131. var text = [];
  132. text.push('<ul class="' + chart.id + '-legend html-legend">');
  133. for (var i = 0; i < chart.data.datasets.length; i++) {
  134. text.push('<li><span style="background-color:' + chart.data.datasets[i].legendColor + '"></span>');
  135. if (chart.data.datasets[i].label) {
  136. text.push(chart.data.datasets[i].label);
  137. }
  138. text.push('</li>');
  139. }
  140. text.push('</ul>');
  141. return text.join('');
  142. }
  143. }
  144. });
  145. var myLegendContainer = document.getElementById("myChartLegend");
  146. // generate HTML legend
  147. myLegendContainer.innerHTML = statisticsChart.generateLegend();
  148. // bind onClick event to all LI-tags of the legend
  149. var legendItems = myLegendContainer.getElementsByTagName('li');
  150. for (var i = 0; i < legendItems.length; i += 1) {
  151. legendItems[i].addEventListener("click", legendClickCallback, false);
  152. }
  153. var dailySalesChart = document.getElementById('dailySalesChart').getContext('2d');
  154. var myDailySalesChart = new Chart(dailySalesChart, {
  155. type: 'line',
  156. data: {
  157. labels:["January",
  158. "February",
  159. "March",
  160. "April",
  161. "May",
  162. "June",
  163. "July",
  164. "August",
  165. "September"],
  166. datasets:[ {
  167. label: "Sales Analytics", fill: !0, backgroundColor: "rgba(255,255,255,0.2)", borderColor: "#fff", borderCapStyle: "butt", borderDash: [], borderDashOffset: 0, pointBorderColor: "#fff", pointBackgroundColor: "#fff", pointBorderWidth: 1, pointHoverRadius: 5, pointHoverBackgroundColor: "#fff", pointHoverBorderColor: "#fff", pointHoverBorderWidth: 1, pointRadius: 1, pointHitRadius: 5, data: [65, 59, 80, 81, 56, 55, 40, 35, 30]
  168. }]
  169. },
  170. options : {
  171. maintainAspectRatio:!1, legend: {
  172. display: !1
  173. }
  174. , animation: {
  175. easing: "easeInOutBack"
  176. }
  177. , scales: {
  178. yAxes:[ {
  179. display:!1, ticks: {
  180. fontColor: "rgba(0,0,0,0.5)", fontStyle: "bold", beginAtZero: !0, maxTicksLimit: 10, padding: 0
  181. }
  182. , gridLines: {
  183. drawTicks: !1, display: !1
  184. }
  185. }
  186. ], xAxes:[ {
  187. display:!1, gridLines: {
  188. zeroLineColor: "transparent"
  189. }
  190. , ticks: {
  191. padding: -20, fontColor: "rgba(255,255,255,0.2)", fontStyle: "bold"
  192. }
  193. }
  194. ]
  195. }
  196. }
  197. });
  198. $("#activeUsersChart").sparkline([112,109,120,107,110,85,87,90,102,109,120,99,110,85,87,94], {
  199. type: 'bar',
  200. height: '100',
  201. barWidth: 9,
  202. barSpacing: 10,
  203. barColor: 'rgba(255,255,255,.3)'
  204. });
  205. var topProductsChart = document.getElementById('topProductsChart').getContext('2d');
  206. var myTopProductsChart = new Chart(topProductsChart, {
  207. type:"line",
  208. data: {
  209. labels:["January",
  210. "February",
  211. "March",
  212. "April",
  213. "May",
  214. "June",
  215. "July",
  216. "August",
  217. "September",
  218. "October",
  219. "January",
  220. "February",
  221. "March",
  222. "April",
  223. "May",
  224. "June",
  225. "July",
  226. "August",
  227. "September",
  228. "October",
  229. "January",
  230. "February",
  231. "March",
  232. "April",
  233. "May",
  234. "June",
  235. "July",
  236. "August",
  237. "September",
  238. "October",
  239. "January",
  240. "February",
  241. "March",
  242. "April"],
  243. datasets:[ {
  244. label: "Sales Analytics", fill: !0, backgroundColor: "rgba(53, 205, 58, 0.2)", borderColor: "#35cd3a", borderCapStyle: "butt", borderDash: [], borderDashOffset: 0, pointBorderColor: "#35cd3a", pointBackgroundColor: "#35cd3a", pointBorderWidth: 1, pointHoverRadius: 5, pointHoverBackgroundColor: "#35cd3a", pointHoverBorderColor: "#35cd3a", pointHoverBorderWidth: 1, pointRadius: 1, pointHitRadius: 5, data: [20, 10, 18, 14, 32, 18, 15, 22, 8, 6, 17, 12, 17, 18, 14, 25, 18, 12, 19, 21, 16, 14, 24, 21, 13, 15, 27, 29, 21, 11, 14, 19, 21, 17]
  245. }
  246. ]
  247. },
  248. options : {
  249. maintainAspectRatio:!1, legend: {
  250. display: !1
  251. }
  252. , animation: {
  253. easing: "easeInOutBack"
  254. }
  255. , scales: {
  256. yAxes:[ {
  257. display:!1, ticks: {
  258. fontColor: "rgba(0,0,0,0.5)", fontStyle: "bold", beginAtZero: !0, maxTicksLimit: 10, padding: 0
  259. }
  260. , gridLines: {
  261. drawTicks: !1, display: !1
  262. }
  263. }
  264. ], xAxes:[ {
  265. display:!1, gridLines: {
  266. zeroLineColor: "transparent"
  267. }
  268. , ticks: {
  269. padding: -20, fontColor: "rgba(255,255,255,0.2)", fontStyle: "bold"
  270. }
  271. }
  272. ]
  273. }
  274. }
  275. });