v1.js 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443
  1. (function (global, factory) {
  2. if (typeof define === "function" && define.amd) {
  3. define("/dashboard/v1", ["jquery", "Site"], factory);
  4. } else if (typeof exports !== "undefined") {
  5. factory(require("jquery"), require("Site"));
  6. } else {
  7. var mod = {
  8. exports: {}
  9. };
  10. factory(global.jQuery, global.Site);
  11. global.dashboardV1 = mod.exports;
  12. }
  13. })(this, function (_jquery, _Site) {
  14. "use strict";
  15. _jquery = babelHelpers.interopRequireDefault(_jquery);
  16. (0, _jquery.default)(document).ready(function ($$$1) {
  17. (0, _Site.run)(); // Widget Linearea Color
  18. // ---------------------
  19. (function () {
  20. var timeline_labels = [];
  21. var timeline_data1 = [];
  22. var timeline_data2 = [];
  23. var timeline_data3 = [];
  24. var totalPoints = 20;
  25. var updateInterval = 2000;
  26. var now = new Date().getTime();
  27. function GetData() {
  28. timeline_labels.shift();
  29. timeline_data1.shift();
  30. timeline_data2.shift();
  31. timeline_data3.shift();
  32. while (timeline_data1.length < totalPoints) {
  33. var x = Math.random() * 100 + 800;
  34. var y = Math.random() * 100 + 400;
  35. var z = Math.random() * 100 + 200;
  36. timeline_labels.push(now += updateInterval);
  37. timeline_data1.push(x);
  38. timeline_data2.push(y);
  39. timeline_data3.push(z);
  40. }
  41. }
  42. var timlelineData = {
  43. labels: timeline_labels,
  44. series: [timeline_data1, timeline_data2, timeline_data3]
  45. };
  46. var timlelineData = {
  47. labels: timeline_labels,
  48. series: [timeline_data1, timeline_data2, timeline_data3]
  49. };
  50. var timelineOptions = {
  51. low: 0,
  52. showArea: true,
  53. showPoint: false,
  54. showLine: false,
  55. fullWidth: true,
  56. chartPadding: {
  57. top: 0,
  58. right: 0,
  59. bottom: 0,
  60. left: 0
  61. },
  62. axisX: {
  63. showLabel: false,
  64. showGrid: false,
  65. offset: 0
  66. },
  67. axisY: {
  68. showLabel: false,
  69. showGrid: false,
  70. offset: 0
  71. },
  72. plugins: [Chartist.plugins.tooltip()]
  73. };
  74. new Chartist.Line("#widgetLineareaColor .ct-chart", timlelineData, timelineOptions);
  75. function update() {
  76. GetData();
  77. new Chartist.Line("#widgetLineareaColor .ct-chart", timlelineData, timelineOptions);
  78. setTimeout(update, updateInterval);
  79. }
  80. update();
  81. })(); // Widget Stacked Bar
  82. // ------------------
  83. (function () {
  84. var timeline_labels = [];
  85. var timeline_data1 = [];
  86. var timeline_data2 = [];
  87. var totalPoints = 30;
  88. var updateInterval = 2500;
  89. var now = new Date().getTime();
  90. function GetData() {
  91. timeline_labels.shift();
  92. timeline_data1.shift();
  93. timeline_data2.shift();
  94. while (timeline_data1.length < totalPoints) {
  95. var x = Math.floor(Math.random() * 100) + 800;
  96. var y = Math.floor(Math.random() * 100) + 600;
  97. timeline_labels.push(now += updateInterval);
  98. timeline_data1.push(x);
  99. timeline_data2.push(y);
  100. }
  101. }
  102. var timlelineData = {
  103. labels: timeline_labels,
  104. series: [timeline_data1, timeline_data2]
  105. };
  106. var timlelineData = {
  107. labels: timeline_labels,
  108. series: [timeline_data1, timeline_data2]
  109. };
  110. var timelineOptions = {
  111. stackBars: true,
  112. fullWidth: true,
  113. seriesBarDistance: 0,
  114. chartPadding: {
  115. top: 0,
  116. right: 30,
  117. bottom: 30,
  118. left: 20
  119. },
  120. axisX: {
  121. showLabel: false,
  122. showGrid: false,
  123. offset: 0
  124. },
  125. axisY: {
  126. showLabel: false,
  127. showGrid: false,
  128. offset: 0
  129. },
  130. plugins: [Chartist.plugins.tooltip()]
  131. };
  132. new Chartist.Bar("#widgetStackedBar .ct-chart", timlelineData, timelineOptions);
  133. function update() {
  134. GetData();
  135. new Chartist.Bar("#widgetStackedBar .ct-chart", timlelineData, timelineOptions);
  136. setTimeout(update, updateInterval);
  137. }
  138. update();
  139. })(); // Widget Statistic
  140. // ----------------
  141. (function () {
  142. (function () {
  143. var defaults = Plugin.getDefaults('vectorMap');
  144. var options = $$$1.extend({}, defaults, {
  145. map: "au_mill",
  146. markers: [{
  147. latLng: [-33.55, 150.53],
  148. name: '1,512 Visits'
  149. }, {
  150. latLng: [-37.5, 144.58],
  151. name: '940 Visits'
  152. }, {
  153. latLng: [-31.58, 115.49],
  154. name: '340 Visits'
  155. }],
  156. markerStyle: {
  157. initial: {
  158. r: 6,
  159. fill: Config.colors("blue-grey", 600),
  160. stroke: Config.colors("blue-grey", 600),
  161. "stroke-width": 6,
  162. "stroke-opacity": 0.6
  163. },
  164. hover: {
  165. r: 10,
  166. fill: Config.colors("blue-grey", 500),
  167. "stroke-width": 0
  168. }
  169. }
  170. }, true);
  171. $$$1('#widgetJvmap').vectorMap(options);
  172. })();
  173. })(); // Widget Linepoint
  174. // ----------------
  175. (function () {
  176. new Chartist.Line("#widgetLinepoint .ct-chart", {
  177. labels: ['1', '2', '3', '4', '5', '6', '7', '8'],
  178. series: [[1, 1.5, 0.5, 2, 1, 2.5, 1.5, 2]]
  179. }, {
  180. low: 0,
  181. showArea: false,
  182. showPoint: true,
  183. showLine: true,
  184. fullWidth: true,
  185. lineSmooth: false,
  186. chartPadding: {
  187. top: 10,
  188. right: -4,
  189. bottom: 10,
  190. left: -4
  191. },
  192. axisX: {
  193. showLabel: false,
  194. showGrid: false,
  195. offset: 0
  196. },
  197. axisY: {
  198. showLabel: false,
  199. showGrid: false,
  200. offset: 0
  201. },
  202. plugins: [Chartist.plugins.tooltip()]
  203. });
  204. })(); // Widget Sale Bar
  205. // ---------------
  206. (function () {
  207. new Chartist.Bar("#widgetSaleBar .ct-chart", {
  208. labels: ['A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'K', 'L', 'M', 'N', 'O', 'P', 'Q'],
  209. series: [[50, 90, 100, 90, 110, 100, 120, 130, 115, 95, 80, 85, 100, 140, 130, 120]]
  210. }, {
  211. low: 0,
  212. fullWidth: true,
  213. chartPadding: {
  214. top: 0,
  215. right: 20,
  216. bottom: 30,
  217. left: 20
  218. },
  219. axisX: {
  220. showLabel: false,
  221. showGrid: false,
  222. offset: 0
  223. },
  224. axisY: {
  225. showLabel: false,
  226. showGrid: false,
  227. offset: 0
  228. },
  229. plugins: [Chartist.plugins.tooltip()]
  230. });
  231. })(); // Widget Overall Views
  232. // --------------------
  233. (function () {
  234. new Chartist.Bar("#widgetOverallViews .small-bar-one", {
  235. labels: ['A', 'B', 'C', 'D', 'E', 'F', 'G', 'H'],
  236. series: [[120, 60, 100, 50, 40, 120, 80, 130]]
  237. }, {
  238. low: 0,
  239. fullWidth: true,
  240. chartPadding: {
  241. top: -10,
  242. right: 0,
  243. bottom: 0,
  244. left: 0
  245. },
  246. axisX: {
  247. showLabel: false,
  248. showGrid: false,
  249. offset: 0
  250. },
  251. axisY: {
  252. showLabel: false,
  253. showGrid: false,
  254. offset: 0
  255. },
  256. plugins: [Chartist.plugins.tooltip()]
  257. });
  258. new Chartist.Bar("#widgetOverallViews .small-bar-two", {
  259. labels: ['A', 'B', 'C', 'D', 'E', 'F', 'G', 'H'],
  260. series: [[50, 90, 30, 90, 130, 40, 120, 90]]
  261. }, {
  262. low: 0,
  263. fullWidth: true,
  264. chartPadding: {
  265. top: -10,
  266. right: 0,
  267. bottom: 0,
  268. left: 0
  269. },
  270. axisX: {
  271. showLabel: false,
  272. showGrid: false,
  273. offset: 0
  274. },
  275. axisY: {
  276. showLabel: false,
  277. showGrid: false,
  278. offset: 0
  279. },
  280. plugins: [Chartist.plugins.tooltip()]
  281. });
  282. new Chartist.Line("#widgetOverallViews .line-chart", {
  283. labels: ['SUN', 'MON', 'TUE', 'WED', 'THU', 'FRI', 'SAT'],
  284. series: [[20, 50, 70, 110, 100, 200, 230], [50, 80, 140, 130, 150, 110, 160]]
  285. }, {
  286. low: 0,
  287. showArea: false,
  288. showPoint: false,
  289. showLine: true,
  290. lineSmooth: false,
  291. fullWidth: true,
  292. chartPadding: {
  293. top: 0,
  294. right: 10,
  295. bottom: 0,
  296. left: 10
  297. },
  298. axisX: {
  299. showLabel: true,
  300. showGrid: false,
  301. offset: 30
  302. },
  303. axisY: {
  304. showLabel: true,
  305. showGrid: true,
  306. offset: 30
  307. },
  308. plugins: [Chartist.plugins.tooltip()]
  309. });
  310. })(); // Widget Timeline
  311. // ---------------
  312. (function () {
  313. var timeline_labels = [];
  314. var timeline_data1 = [];
  315. var timeline_data2 = [];
  316. var totalPoints = 20;
  317. var updateInterval = 1000;
  318. var now = new Date().getTime();
  319. function GetData() {
  320. timeline_labels.shift();
  321. timeline_data1.shift();
  322. timeline_data2.shift();
  323. while (timeline_data1.length < totalPoints) {
  324. var x = Math.random() * 100 + 800;
  325. var y = Math.random() * 100 + 400;
  326. timeline_labels.push(now += updateInterval);
  327. timeline_data1.push(x);
  328. timeline_data2.push(y);
  329. }
  330. }
  331. var timlelineData = {
  332. labels: timeline_labels,
  333. series: [timeline_data1, timeline_data2]
  334. };
  335. var timelineOptions = {
  336. low: 0,
  337. showArea: true,
  338. showPoint: false,
  339. showLine: false,
  340. fullWidth: true,
  341. chartPadding: {
  342. top: 0,
  343. right: 0,
  344. bottom: 0,
  345. left: 0
  346. },
  347. axisX: {
  348. showLabel: false,
  349. showGrid: false,
  350. offset: 0
  351. },
  352. axisY: {
  353. showLabel: false,
  354. showGrid: false,
  355. offset: 0
  356. },
  357. plugins: [Chartist.plugins.tooltip()]
  358. };
  359. new Chartist.Line("#widgetTimeline .ct-chart", timlelineData, timelineOptions);
  360. function update() {
  361. GetData();
  362. new Chartist.Line("#widgetTimeline .ct-chart", timlelineData, timelineOptions);
  363. setTimeout(update, updateInterval);
  364. }
  365. update();
  366. })();
  367. (function () {
  368. var snow = new Skycons({
  369. "color": Config.colors("blue-grey", 500)
  370. });
  371. snow.set(document.getElementById("widgetSnow"), "snow");
  372. snow.play();
  373. var sunny = new Skycons({
  374. "color": Config.colors("blue-grey", 700)
  375. });
  376. sunny.set(document.getElementById("widgetSunny"), "clear-day");
  377. sunny.play();
  378. })(); // Widget Linepoint
  379. // ----------------
  380. (function () {
  381. new Chartist.Line("#widgetLinepointDate .ct-chart", {
  382. labels: ['1', '2', '3', '4', '5', '6', '7', '8'],
  383. series: [[36, 45, 28, 19, 39, 46, 35, 13]]
  384. }, {
  385. low: 0,
  386. showArea: false,
  387. showPoint: true,
  388. showLine: true,
  389. fullWidth: true,
  390. lineSmooth: false,
  391. chartPadding: {
  392. top: 5,
  393. right: -4,
  394. bottom: 10,
  395. left: -4
  396. },
  397. axisX: {
  398. showLabel: false,
  399. showGrid: false,
  400. offset: 0
  401. },
  402. axisY: {
  403. showLabel: false,
  404. showGrid: false,
  405. offset: 0
  406. },
  407. plugins: [Chartist.plugins.tooltip()]
  408. });
  409. })();
  410. });
  411. });