Source: custom.js

  1. /**
  2. * Resize function without multiple trigger
  3. *
  4. * Usage:
  5. * $(window).smartresize(function(){
  6. * // code here
  7. * });
  8. */
  9. (function($,sr){
  10. // debouncing function from John Hann
  11. // http://unscriptable.com/index.php/2009/03/20/debouncing-javascript-methods/
  12. var debounce = function (func, threshold, execAsap) {
  13. var timeout;
  14. return function debounced () {
  15. var obj = this, args = arguments;
  16. function delayed () {
  17. if (!execAsap)
  18. func.apply(obj, args);
  19. timeout = null;
  20. }
  21. if (timeout)
  22. clearTimeout(timeout);
  23. else if (execAsap)
  24. func.apply(obj, args);
  25. timeout = setTimeout(delayed, threshold || 100);
  26. };
  27. };
  28. // smartresize
  29. jQuery.fn[sr] = function(fn){ return fn ? this.bind('resize', debounce(fn)) : this.trigger(sr); };
  30. })(jQuery,'smartresize');
  31. /**
  32. * To change this license header, choose License Headers in Project Properties.
  33. * To change this template file, choose Tools | Templates
  34. * and open the template in the editor.
  35. */
  36. var CURRENT_URL = window.location.href.split('#')[0].split('?')[0],
  37. $BODY = $('body'),
  38. $MENU_TOGGLE = $('#menu_toggle'),
  39. $SIDEBAR_MENU = $('#sidebar-menu'),
  40. $SIDEBAR_FOOTER = $('.sidebar-footer'),
  41. $LEFT_COL = $('.left_col'),
  42. $RIGHT_COL = $('.right_col'),
  43. $NAV_MENU = $('.nav_menu'),
  44. $FOOTER = $('footer');
  45. // Sidebar
  46. function init_sidebar() {
  47. // TODO: This is some kind of easy fix, maybe we can improve this
  48. var setContentHeight = function () {
  49. // reset height
  50. $RIGHT_COL.css('min-height', $(window).height());
  51. var bodyHeight = $BODY.outerHeight(),
  52. footerHeight = $BODY.hasClass('footer_fixed') ? -10 : $FOOTER.height(),
  53. leftColHeight = $LEFT_COL.eq(1).height() + $SIDEBAR_FOOTER.height(),
  54. contentHeight = bodyHeight < leftColHeight ? leftColHeight : bodyHeight;
  55. // normalize content
  56. contentHeight -= $NAV_MENU.height() + footerHeight;
  57. $RIGHT_COL.css('min-height', contentHeight);
  58. };
  59. $SIDEBAR_MENU.find('a').on('click', function(ev) {
  60. console.log('clicked - sidebar_menu');
  61. var $li = $(this).parent();
  62. if ($li.is('.active')) {
  63. $li.removeClass('active active-sm');
  64. $('ul:first', $li).slideUp(function() {
  65. setContentHeight();
  66. });
  67. } else {
  68. // prevent closing menu if we are on child menu
  69. if (!$li.parent().is('.child_menu')) {
  70. $SIDEBAR_MENU.find('li').removeClass('active active-sm');
  71. $SIDEBAR_MENU.find('li ul').slideUp();
  72. }else
  73. {
  74. if ( $BODY.is( ".nav-sm" ) )
  75. {
  76. $SIDEBAR_MENU.find( "li" ).removeClass( "active active-sm" );
  77. $SIDEBAR_MENU.find( "li ul" ).slideUp();
  78. }
  79. }
  80. $li.addClass('active');
  81. $('ul:first', $li).slideDown(function() {
  82. setContentHeight();
  83. });
  84. }
  85. });
  86. // toggle small or large menu
  87. $MENU_TOGGLE.on('click', function() {
  88. console.log('clicked - menu toggle');
  89. if ($BODY.hasClass('nav-md')) {
  90. $SIDEBAR_MENU.find('li.active ul').hide();
  91. $SIDEBAR_MENU.find('li.active').addClass('active-sm').removeClass('active');
  92. } else {
  93. $SIDEBAR_MENU.find('li.active-sm ul').show();
  94. $SIDEBAR_MENU.find('li.active-sm').addClass('active').removeClass('active-sm');
  95. }
  96. $BODY.toggleClass('nav-md nav-sm');
  97. setContentHeight();
  98. $('.dataTable').each ( function () { $(this).dataTable().fnDraw(); });
  99. });
  100. // check active menu
  101. $SIDEBAR_MENU.find('a[href="' + CURRENT_URL + '"]').parent('li').addClass('current-page');
  102. $SIDEBAR_MENU.find('a').filter(function () {
  103. return this.href == CURRENT_URL;
  104. }).parent('li').addClass('current-page').parents('ul').slideDown(function() {
  105. setContentHeight();
  106. }).parent().addClass('active');
  107. // recompute content when resizing
  108. $(window).smartresize(function(){
  109. setContentHeight();
  110. });
  111. setContentHeight();
  112. // fixed sidebar
  113. if ($.fn.mCustomScrollbar) {
  114. $('.menu_fixed').mCustomScrollbar({
  115. autoHideScrollbar: true,
  116. theme: 'minimal',
  117. mouseWheel:{ preventDefault: true }
  118. });
  119. }
  120. };
  121. // /Sidebar
  122. var randNum = function() {
  123. return (Math.floor(Math.random() * (1 + 40 - 20))) + 20;
  124. };
  125. // Panel toolbox
  126. $(document).ready(function() {
  127. $('.collapse-link').on('click', function() {
  128. var $BOX_PANEL = $(this).closest('.x_panel'),
  129. $ICON = $(this).find('i'),
  130. $BOX_CONTENT = $BOX_PANEL.find('.x_content');
  131. // fix for some div with hardcoded fix class
  132. if ($BOX_PANEL.attr('style')) {
  133. $BOX_CONTENT.slideToggle(200, function(){
  134. $BOX_PANEL.removeAttr('style');
  135. });
  136. } else {
  137. $BOX_CONTENT.slideToggle(200);
  138. $BOX_PANEL.css('height', 'auto');
  139. }
  140. $ICON.toggleClass('fa-chevron-up fa-chevron-down');
  141. });
  142. $('.close-link').click(function () {
  143. var $BOX_PANEL = $(this).closest('.x_panel');
  144. $BOX_PANEL.remove();
  145. });
  146. });
  147. // /Panel toolbox
  148. // Tooltip
  149. $(document).ready(function() {
  150. $('[data-toggle="tooltip"]').tooltip({
  151. container: 'body'
  152. });
  153. });
  154. // /Tooltip
  155. // Progressbar
  156. if ($(".progress .progress-bar")[0]) {
  157. $('.progress .progress-bar').progressbar();
  158. }
  159. // /Progressbar
  160. // Switchery
  161. $(document).ready(function() {
  162. if ($(".js-switch")[0]) {
  163. var elems = Array.prototype.slice.call(document.querySelectorAll('.js-switch'));
  164. elems.forEach(function (html) {
  165. var switchery = new Switchery(html, {
  166. color: '#26B99A'
  167. });
  168. });
  169. }
  170. });
  171. // /Switchery
  172. // iCheck
  173. $(document).ready(function() {
  174. if ($("input.flat")[0]) {
  175. $(document).ready(function () {
  176. $('input.flat').iCheck({
  177. checkboxClass: 'icheckbox_flat-green',
  178. radioClass: 'iradio_flat-green'
  179. });
  180. });
  181. }
  182. });
  183. // /iCheck
  184. // Table
  185. $('table input').on('ifChecked', function () {
  186. checkState = '';
  187. $(this).parent().parent().parent().addClass('selected');
  188. countChecked();
  189. });
  190. $('table input').on('ifUnchecked', function () {
  191. checkState = '';
  192. $(this).parent().parent().parent().removeClass('selected');
  193. countChecked();
  194. });
  195. var checkState = '';
  196. $('.bulk_action input').on('ifChecked', function () {
  197. checkState = '';
  198. $(this).parent().parent().parent().addClass('selected');
  199. countChecked();
  200. });
  201. $('.bulk_action input').on('ifUnchecked', function () {
  202. checkState = '';
  203. $(this).parent().parent().parent().removeClass('selected');
  204. countChecked();
  205. });
  206. $('.bulk_action input#check-all').on('ifChecked', function () {
  207. checkState = 'all';
  208. countChecked();
  209. });
  210. $('.bulk_action input#check-all').on('ifUnchecked', function () {
  211. checkState = 'none';
  212. countChecked();
  213. });
  214. function countChecked() {
  215. if (checkState === 'all') {
  216. $(".bulk_action input[name='table_records']").iCheck('check');
  217. }
  218. if (checkState === 'none') {
  219. $(".bulk_action input[name='table_records']").iCheck('uncheck');
  220. }
  221. var checkCount = $(".bulk_action input[name='table_records']:checked").length;
  222. if (checkCount) {
  223. $('.column-title').hide();
  224. $('.bulk-actions').show();
  225. $('.action-cnt').html(checkCount + ' Records Selected');
  226. } else {
  227. $('.column-title').show();
  228. $('.bulk-actions').hide();
  229. }
  230. }
  231. // Accordion
  232. $(document).ready(function() {
  233. $(".expand").on("click", function () {
  234. $(this).next().slideToggle(200);
  235. $expand = $(this).find(">:first-child");
  236. if ($expand.text() == "+") {
  237. $expand.text("-");
  238. } else {
  239. $expand.text("+");
  240. }
  241. });
  242. });
  243. // NProgress
  244. if (typeof NProgress != 'undefined') {
  245. $(document).ready(function () {
  246. NProgress.start();
  247. });
  248. $(window).load(function () {
  249. NProgress.done();
  250. });
  251. }
  252. //hover and retain popover when on popover content
  253. var originalLeave = $.fn.popover.Constructor.prototype.leave;
  254. $.fn.popover.Constructor.prototype.leave = function(obj) {
  255. var self = obj instanceof this.constructor ?
  256. obj : $(obj.currentTarget)[this.type](this.getDelegateOptions()).data('bs.' + this.type);
  257. var container, timeout;
  258. originalLeave.call(this, obj);
  259. if (obj.currentTarget) {
  260. container = $(obj.currentTarget).siblings('.popover');
  261. timeout = self.timeout;
  262. container.one('mouseenter', function() {
  263. //We entered the actual popover – call off the dogs
  264. clearTimeout(timeout);
  265. //Let's monitor popover content instead
  266. container.one('mouseleave', function() {
  267. $.fn.popover.Constructor.prototype.leave.call(self, self);
  268. });
  269. });
  270. }
  271. };
  272. $('body').popover({
  273. selector: '[data-popover]',
  274. trigger: 'click hover',
  275. delay: {
  276. show: 50,
  277. hide: 400
  278. }
  279. });
  280. function gd(year, month, day) {
  281. return new Date(year, month - 1, day).getTime();
  282. }
  283. function init_flot_chart(){
  284. if( typeof ($.plot) === 'undefined'){ return; }
  285. console.log('init_flot_chart');
  286. var arr_data1 = [
  287. [gd(2012, 1, 1), 17],
  288. [gd(2012, 1, 2), 74],
  289. [gd(2012, 1, 3), 6],
  290. [gd(2012, 1, 4), 39],
  291. [gd(2012, 1, 5), 20],
  292. [gd(2012, 1, 6), 85],
  293. [gd(2012, 1, 7), 7]
  294. ];
  295. var arr_data2 = [
  296. [gd(2012, 1, 1), 82],
  297. [gd(2012, 1, 2), 23],
  298. [gd(2012, 1, 3), 66],
  299. [gd(2012, 1, 4), 9],
  300. [gd(2012, 1, 5), 119],
  301. [gd(2012, 1, 6), 6],
  302. [gd(2012, 1, 7), 9]
  303. ];
  304. var arr_data3 = [
  305. [0, 1],
  306. [1, 9],
  307. [2, 6],
  308. [3, 10],
  309. [4, 5],
  310. [5, 17],
  311. [6, 6],
  312. [7, 10],
  313. [8, 7],
  314. [9, 11],
  315. [10, 35],
  316. [11, 9],
  317. [12, 12],
  318. [13, 5],
  319. [14, 3],
  320. [15, 4],
  321. [16, 9]
  322. ];
  323. var chart_plot_02_data = [];
  324. var chart_plot_03_data = [
  325. [0, 1],
  326. [1, 9],
  327. [2, 6],
  328. [3, 10],
  329. [4, 5],
  330. [5, 17],
  331. [6, 6],
  332. [7, 10],
  333. [8, 7],
  334. [9, 11],
  335. [10, 35],
  336. [11, 9],
  337. [12, 12],
  338. [13, 5],
  339. [14, 3],
  340. [15, 4],
  341. [16, 9]
  342. ];
  343. for (var i = 0; i < 30; i++) {
  344. chart_plot_02_data.push([new Date(Date.today().add(i).days()).getTime(), randNum() + i + i + 10]);
  345. }
  346. var chart_plot_01_settings = {
  347. series: {
  348. lines: {
  349. show: false,
  350. fill: true
  351. },
  352. splines: {
  353. show: true,
  354. tension: 0.4,
  355. lineWidth: 1,
  356. fill: 0.4
  357. },
  358. points: {
  359. radius: 0,
  360. show: true
  361. },
  362. shadowSize: 2
  363. },
  364. grid: {
  365. verticalLines: true,
  366. hoverable: true,
  367. clickable: true,
  368. tickColor: "#d5d5d5",
  369. borderWidth: 1,
  370. color: '#fff'
  371. },
  372. colors: ["rgba(38, 185, 154, 0.38)", "rgba(3, 88, 106, 0.38)"],
  373. xaxis: {
  374. tickColor: "rgba(51, 51, 51, 0.06)",
  375. mode: "time",
  376. tickSize: [1, "day"],
  377. //tickLength: 10,
  378. axisLabel: "Date",
  379. axisLabelUseCanvas: true,
  380. axisLabelFontSizePixels: 12,
  381. axisLabelFontFamily: 'Verdana, Arial',
  382. axisLabelPadding: 10
  383. },
  384. yaxis: {
  385. ticks: 8,
  386. tickColor: "rgba(51, 51, 51, 0.06)",
  387. },
  388. tooltip: false
  389. }
  390. var chart_plot_02_settings = {
  391. grid: {
  392. show: true,
  393. aboveData: true,
  394. color: "#3f3f3f",
  395. labelMargin: 10,
  396. axisMargin: 0,
  397. borderWidth: 0,
  398. borderColor: null,
  399. minBorderMargin: 5,
  400. clickable: true,
  401. hoverable: true,
  402. autoHighlight: true,
  403. mouseActiveRadius: 100
  404. },
  405. series: {
  406. lines: {
  407. show: true,
  408. fill: true,
  409. lineWidth: 2,
  410. steps: false
  411. },
  412. points: {
  413. show: true,
  414. radius: 4.5,
  415. symbol: "circle",
  416. lineWidth: 3.0
  417. }
  418. },
  419. legend: {
  420. position: "ne",
  421. margin: [0, -25],
  422. noColumns: 0,
  423. labelBoxBorderColor: null,
  424. labelFormatter: function(label, series) {
  425. return label + '&nbsp;&nbsp;';
  426. },
  427. width: 40,
  428. height: 1
  429. },
  430. colors: ['#96CA59', '#3F97EB', '#72c380', '#6f7a8a', '#f7cb38', '#5a8022', '#2c7282'],
  431. shadowSize: 0,
  432. tooltip: true,
  433. tooltipOpts: {
  434. content: "%s: %y.0",
  435. xDateFormat: "%d/%m",
  436. shifts: {
  437. x: -30,
  438. y: -50
  439. },
  440. defaultTheme: false
  441. },
  442. yaxis: {
  443. min: 0
  444. },
  445. xaxis: {
  446. mode: "time",
  447. minTickSize: [1, "day"],
  448. timeformat: "%d/%m/%y",
  449. min: chart_plot_02_data[0][0],
  450. max: chart_plot_02_data[20][0]
  451. }
  452. };
  453. var chart_plot_03_settings = {
  454. series: {
  455. curvedLines: {
  456. apply: true,
  457. active: true,
  458. monotonicFit: true
  459. }
  460. },
  461. colors: ["#26B99A"],
  462. grid: {
  463. borderWidth: {
  464. top: 0,
  465. right: 0,
  466. bottom: 1,
  467. left: 1
  468. },
  469. borderColor: {
  470. bottom: "#7F8790",
  471. left: "#7F8790"
  472. }
  473. }
  474. };
  475. if ($("#chart_plot_01").length){
  476. console.log('Plot1');
  477. $.plot( $("#chart_plot_01"), [ arr_data1, arr_data2 ], chart_plot_01_settings );
  478. }
  479. if ($("#chart_plot_02").length){
  480. console.log('Plot2');
  481. $.plot( $("#chart_plot_02"),
  482. [{
  483. label: "Email Sent",
  484. data: chart_plot_02_data,
  485. lines: {
  486. fillColor: "rgba(150, 202, 89, 0.12)"
  487. },
  488. points: {
  489. fillColor: "#fff" }
  490. }], chart_plot_02_settings);
  491. }
  492. if ($("#chart_plot_03").length){
  493. console.log('Plot3');
  494. $.plot($("#chart_plot_03"), [{
  495. label: "Registrations",
  496. data: chart_plot_03_data,
  497. lines: {
  498. fillColor: "rgba(150, 202, 89, 0.12)"
  499. },
  500. points: {
  501. fillColor: "#fff"
  502. }
  503. }], chart_plot_03_settings);
  504. };
  505. }
  506. /* STARRR */
  507. function init_starrr() {
  508. if( typeof (starrr) === 'undefined'){ return; }
  509. console.log('init_starrr');
  510. $(".stars").starrr();
  511. $('.stars-existing').starrr({
  512. rating: 4
  513. });
  514. $('.stars').on('starrr:change', function (e, value) {
  515. $('.stars-count').html(value);
  516. });
  517. $('.stars-existing').on('starrr:change', function (e, value) {
  518. $('.stars-count-existing').html(value);
  519. });
  520. };
  521. function init_JQVmap(){
  522. //console.log('check init_JQVmap [' + typeof (VectorCanvas) + '][' + typeof (jQuery.fn.vectorMap) + ']' );
  523. if(typeof (jQuery.fn.vectorMap) === 'undefined'){ return; }
  524. console.log('init_JQVmap');
  525. if ($('#world-map-gdp').length ){
  526. $('#world-map-gdp').vectorMap({
  527. map: 'world_en',
  528. backgroundColor: null,
  529. color: '#ffffff',
  530. hoverOpacity: 0.7,
  531. selectedColor: '#666666',
  532. enableZoom: true,
  533. showTooltip: true,
  534. values: sample_data,
  535. scaleColors: ['#E6F2F0', '#149B7E'],
  536. normalizeFunction: 'polynomial'
  537. });
  538. }
  539. if ($('#usa_map').length ){
  540. $('#usa_map').vectorMap({
  541. map: 'usa_en',
  542. backgroundColor: null,
  543. color: '#ffffff',
  544. hoverOpacity: 0.7,
  545. selectedColor: '#666666',
  546. enableZoom: true,
  547. showTooltip: true,
  548. values: sample_data,
  549. scaleColors: ['#E6F2F0', '#149B7E'],
  550. normalizeFunction: 'polynomial'
  551. });
  552. }
  553. };
  554. function init_skycons(){
  555. if( typeof (Skycons) === 'undefined'){ return; }
  556. console.log('init_skycons');
  557. var icons = new Skycons({
  558. "color": "#73879C"
  559. }),
  560. list = [
  561. "clear-day", "clear-night", "partly-cloudy-day",
  562. "partly-cloudy-night", "cloudy", "rain", "sleet", "snow", "wind",
  563. "fog"
  564. ],
  565. i;
  566. for (i = list.length; i--;)
  567. icons.set(list[i], list[i]);
  568. icons.play();
  569. }
  570. function init_chart_doughnut(){
  571. if( typeof (Chart) === 'undefined'){ return; }
  572. console.log('init_chart_doughnut');
  573. if ($('.canvasDoughnut').length){
  574. var chart_doughnut_settings = {
  575. type: 'doughnut',
  576. tooltipFillColor: "rgba(51, 51, 51, 0.55)",
  577. data: {
  578. labels: [
  579. "Symbian",
  580. "Blackberry",
  581. "Other",
  582. "Android",
  583. "IOS"
  584. ],
  585. datasets: [{
  586. data: [15, 20, 30, 10, 30],
  587. backgroundColor: [
  588. "#BDC3C7",
  589. "#9B59B6",
  590. "#E74C3C",
  591. "#26B99A",
  592. "#3498DB"
  593. ],
  594. hoverBackgroundColor: [
  595. "#CFD4D8",
  596. "#B370CF",
  597. "#E95E4F",
  598. "#36CAAB",
  599. "#49A9EA"
  600. ]
  601. }]
  602. },
  603. options: {
  604. legend: false,
  605. responsive: false
  606. }
  607. }
  608. $('.canvasDoughnut').each(function(){
  609. var chart_element = $(this);
  610. var chart_doughnut = new Chart( chart_element, chart_doughnut_settings);
  611. });
  612. }
  613. }
  614. function init_gauge() {
  615. if( typeof (Gauge) === 'undefined'){ return; }
  616. console.log('init_gauge [' + $('.gauge-chart').length + ']');
  617. console.log('init_gauge');
  618. var chart_gauge_settings = {
  619. lines: 12,
  620. angle: 0,
  621. lineWidth: 0.4,
  622. pointer: {
  623. length: 0.75,
  624. strokeWidth: 0.042,
  625. color: '#1D212A'
  626. },
  627. limitMax: 'false',
  628. colorStart: '#1ABC9C',
  629. colorStop: '#1ABC9C',
  630. strokeColor: '#F0F3F3',
  631. generateGradient: true
  632. };
  633. if ($('#chart_gauge_01').length){
  634. var chart_gauge_01_elem = document.getElementById('chart_gauge_01');
  635. var chart_gauge_01 = new Gauge(chart_gauge_01_elem).setOptions(chart_gauge_settings);
  636. }
  637. if ($('#gauge-text').length){
  638. chart_gauge_01.maxValue = 6000;
  639. chart_gauge_01.animationSpeed = 32;
  640. chart_gauge_01.set(3200);
  641. chart_gauge_01.setTextField(document.getElementById("gauge-text"));
  642. }
  643. if ($('#chart_gauge_02').length){
  644. var chart_gauge_02_elem = document.getElementById('chart_gauge_02');
  645. var chart_gauge_02 = new Gauge(chart_gauge_02_elem).setOptions(chart_gauge_settings);
  646. }
  647. if ($('#gauge-text2').length){
  648. chart_gauge_02.maxValue = 9000;
  649. chart_gauge_02.animationSpeed = 32;
  650. chart_gauge_02.set(2400);
  651. chart_gauge_02.setTextField(document.getElementById("gauge-text2"));
  652. }
  653. }
  654. /* SPARKLINES */
  655. function init_sparklines() {
  656. if(typeof (jQuery.fn.sparkline) === 'undefined'){ return; }
  657. console.log('init_sparklines');
  658. $(".sparkline_one").sparkline([2, 4, 3, 4, 5, 4, 5, 4, 3, 4, 5, 6, 4, 5, 6, 3, 5, 4, 5, 4, 5, 4, 3, 4, 5, 6, 7, 5, 4, 3, 5, 6], {
  659. type: 'bar',
  660. height: '125',
  661. barWidth: 13,
  662. colorMap: {
  663. '7': '#a1a1a1'
  664. },
  665. barSpacing: 2,
  666. barColor: '#26B99A'
  667. });
  668. $(".sparkline_two").sparkline([2, 4, 3, 4, 5, 4, 5, 4, 3, 4, 5, 6, 7, 5, 4, 3, 5, 6], {
  669. type: 'bar',
  670. height: '40',
  671. barWidth: 9,
  672. colorMap: {
  673. '7': '#a1a1a1'
  674. },
  675. barSpacing: 2,
  676. barColor: '#26B99A'
  677. });
  678. $(".sparkline_three").sparkline([2, 4, 3, 4, 5, 4, 5, 4, 3, 4, 5, 6, 7, 5, 4, 3, 5, 6], {
  679. type: 'line',
  680. width: '200',
  681. height: '40',
  682. lineColor: '#26B99A',
  683. fillColor: 'rgba(223, 223, 223, 0.57)',
  684. lineWidth: 2,
  685. spotColor: '#26B99A',
  686. minSpotColor: '#26B99A'
  687. });
  688. $(".sparkline11").sparkline([2, 4, 3, 4, 5, 4, 5, 4, 3, 4, 6, 2, 4, 3, 4, 5, 4, 5, 4, 3], {
  689. type: 'bar',
  690. height: '40',
  691. barWidth: 8,
  692. colorMap: {
  693. '7': '#a1a1a1'
  694. },
  695. barSpacing: 2,
  696. barColor: '#26B99A'
  697. });
  698. $(".sparkline22").sparkline([2, 4, 3, 4, 7, 5, 4, 3, 5, 6, 2, 4, 3, 4, 5, 4, 5, 4, 3, 4, 6], {
  699. type: 'line',
  700. height: '40',
  701. width: '200',
  702. lineColor: '#26B99A',
  703. fillColor: '#ffffff',
  704. lineWidth: 3,
  705. spotColor: '#34495E',
  706. minSpotColor: '#34495E'
  707. });
  708. $(".sparkline_bar").sparkline([2, 4, 3, 4, 5, 4, 5, 4, 3, 4, 5, 6, 4, 5, 6, 3, 5], {
  709. type: 'bar',
  710. colorMap: {
  711. '7': '#a1a1a1'
  712. },
  713. barColor: '#26B99A'
  714. });
  715. $(".sparkline_area").sparkline([5, 6, 7, 9, 9, 5, 3, 2, 2, 4, 6, 7], {
  716. type: 'line',
  717. lineColor: '#26B99A',
  718. fillColor: '#26B99A',
  719. spotColor: '#4578a0',
  720. minSpotColor: '#728fb2',
  721. maxSpotColor: '#6d93c4',
  722. highlightSpotColor: '#ef5179',
  723. highlightLineColor: '#8ba8bf',
  724. spotRadius: 2.5,
  725. width: 85
  726. });
  727. $(".sparkline_line").sparkline([2, 4, 3, 4, 5, 4, 5, 4, 3, 4, 5, 6, 4, 5, 6, 3, 5], {
  728. type: 'line',
  729. lineColor: '#26B99A',
  730. fillColor: '#ffffff',
  731. width: 85,
  732. spotColor: '#34495E',
  733. minSpotColor: '#34495E'
  734. });
  735. $(".sparkline_pie").sparkline([1, 1, 2, 1], {
  736. type: 'pie',
  737. sliceColors: ['#26B99A', '#ccc', '#75BCDD', '#D66DE2']
  738. });
  739. $(".sparkline_discreet").sparkline([4, 6, 7, 7, 4, 3, 2, 1, 4, 4, 2, 4, 3, 7, 8, 9, 7, 6, 4, 3], {
  740. type: 'discrete',
  741. barWidth: 3,
  742. lineColor: '#26B99A',
  743. width: '85',
  744. });
  745. };
  746. /* AUTOCOMPLETE */
  747. function init_autocomplete() {
  748. if( typeof (autocomplete) === 'undefined'){ return; }
  749. console.log('init_autocomplete');
  750. var countries = { AD:"Andorra",A2:"Andorra Test",AE:"United Arab Emirates",AF:"Afghanistan",AG:"Antigua and Barbuda",AI:"Anguilla",AL:"Albania",AM:"Armenia",AN:"Netherlands Antilles",AO:"Angola",AQ:"Antarctica",AR:"Argentina",AS:"American Samoa",AT:"Austria",AU:"Australia",AW:"Aruba",AX:"Åland Islands",AZ:"Azerbaijan",BA:"Bosnia and Herzegovina",BB:"Barbados",BD:"Bangladesh",BE:"Belgium",BF:"Burkina Faso",BG:"Bulgaria",BH:"Bahrain",BI:"Burundi",BJ:"Benin",BL:"Saint Barthélemy",BM:"Bermuda",BN:"Brunei",BO:"Bolivia",BQ:"British Antarctic Territory",BR:"Brazil",BS:"Bahamas",BT:"Bhutan",BV:"Bouvet Island",BW:"Botswana",BY:"Belarus",BZ:"Belize",CA:"Canada",CC:"Cocos [Keeling] Islands",CD:"Congo - Kinshasa",CF:"Central African Republic",CG:"Congo - Brazzaville",CH:"Switzerland",CI:"Côte d’Ivoire",CK:"Cook Islands",CL:"Chile",CM:"Cameroon",CN:"China",CO:"Colombia",CR:"Costa Rica",CS:"Serbia and Montenegro",CT:"Canton and Enderbury Islands",CU:"Cuba",CV:"Cape Verde",CX:"Christmas Island",CY:"Cyprus",CZ:"Czech Republic",DD:"East Germany",DE:"Germany",DJ:"Djibouti",DK:"Denmark",DM:"Dominica",DO:"Dominican Republic",DZ:"Algeria",EC:"Ecuador",EE:"Estonia",EG:"Egypt",EH:"Western Sahara",ER:"Eritrea",ES:"Spain",ET:"Ethiopia",FI:"Finland",FJ:"Fiji",FK:"Falkland Islands",FM:"Micronesia",FO:"Faroe Islands",FQ:"French Southern and Antarctic Territories",FR:"France",FX:"Metropolitan France",GA:"Gabon",GB:"United Kingdom",GD:"Grenada",GE:"Georgia",GF:"French Guiana",GG:"Guernsey",GH:"Ghana",GI:"Gibraltar",GL:"Greenland",GM:"Gambia",GN:"Guinea",GP:"Guadeloupe",GQ:"Equatorial Guinea",GR:"Greece",GS:"South Georgia and the South Sandwich Islands",GT:"Guatemala",GU:"Guam",GW:"Guinea-Bissau",GY:"Guyana",HK:"Hong Kong SAR China",HM:"Heard Island and McDonald Islands",HN:"Honduras",HR:"Croatia",HT:"Haiti",HU:"Hungary",ID:"Indonesia",IE:"Ireland",IL:"Israel",IM:"Isle of Man",IN:"India",IO:"British Indian Ocean Territory",IQ:"Iraq",IR:"Iran",IS:"Iceland",IT:"Italy",JE:"Jersey",JM:"Jamaica",JO:"Jordan",JP:"Japan",JT:"Johnston Island",KE:"Kenya",KG:"Kyrgyzstan",KH:"Cambodia",KI:"Kiribati",KM:"Comoros",KN:"Saint Kitts and Nevis",KP:"North Korea",KR:"South Korea",KW:"Kuwait",KY:"Cayman Islands",KZ:"Kazakhstan",LA:"Laos",LB:"Lebanon",LC:"Saint Lucia",LI:"Liechtenstein",LK:"Sri Lanka",LR:"Liberia",LS:"Lesotho",LT:"Lithuania",LU:"Luxembourg",LV:"Latvia",LY:"Libya",MA:"Morocco",MC:"Monaco",MD:"Moldova",ME:"Montenegro",MF:"Saint Martin",MG:"Madagascar",MH:"Marshall Islands",MI:"Midway Islands",MK:"Macedonia",ML:"Mali",MM:"Myanmar [Burma]",MN:"Mongolia",MO:"Macau SAR China",MP:"Northern Mariana Islands",MQ:"Martinique",MR:"Mauritania",MS:"Montserrat",MT:"Malta",MU:"Mauritius",MV:"Maldives",MW:"Malawi",MX:"Mexico",MY:"Malaysia",MZ:"Mozambique",NA:"Namibia",NC:"New Caledonia",NE:"Niger",NF:"Norfolk Island",NG:"Nigeria",NI:"Nicaragua",NL:"Netherlands",NO:"Norway",NP:"Nepal",NQ:"Dronning Maud Land",NR:"Nauru",NT:"Neutral Zone",NU:"Niue",NZ:"New Zealand",OM:"Oman",PA:"Panama",PC:"Pacific Islands Trust Territory",PE:"Peru",PF:"French Polynesia",PG:"Papua New Guinea",PH:"Philippines",PK:"Pakistan",PL:"Poland",PM:"Saint Pierre and Miquelon",PN:"Pitcairn Islands",PR:"Puerto Rico",PS:"Palestinian Territories",PT:"Portugal",PU:"U.S. Miscellaneous Pacific Islands",PW:"Palau",PY:"Paraguay",PZ:"Panama Canal Zone",QA:"Qatar",RE:"Réunion",RO:"Romania",RS:"Serbia",RU:"Russia",RW:"Rwanda",SA:"Saudi Arabia",SB:"Solomon Islands",SC:"Seychelles",SD:"Sudan",SE:"Sweden",SG:"Singapore",SH:"Saint Helena",SI:"Slovenia",SJ:"Svalbard and Jan Mayen",SK:"Slovakia",SL:"Sierra Leone",SM:"San Marino",SN:"Senegal",SO:"Somalia",SR:"Suriname",ST:"São Tomé and Príncipe",SU:"Union of Soviet Socialist Republics",SV:"El Salvador",SY:"Syria",SZ:"Swaziland",TC:"Turks and Caicos Islands",TD:"Chad",TF:"French Southern Territories",TG:"Togo",TH:"Thailand",TJ:"Tajikistan",TK:"Tokelau",TL:"Timor-Leste",TM:"Turkmenistan",TN:"Tunisia",TO:"Tonga",TR:"Turkey",TT:"Trinidad and Tobago",TV:"Tuvalu",TW:"Taiwan",TZ:"Tanzania",UA:"Ukraine",UG:"Uganda",UM:"U.S. Minor Outlying Islands",US:"United States",UY:"Uruguay",UZ:"Uzbekistan",VA:"Vatican City",VC:"Saint Vincent and the Grenadines",VD:"North Vietnam",VE:"Venezuela",VG:"British Virgin Islands",VI:"U.S. Virgin Islands",VN:"Vietnam",VU:"Vanuatu",WF:"Wallis and Futuna",WK:"Wake Island",WS:"Samoa",YD:"People's Democratic Republic of Yemen",YE:"Yemen",YT:"Mayotte",ZA:"South Africa",ZM:"Zambia",ZW:"Zimbabwe",ZZ:"Unknown or Invalid Region" };
  751. var countriesArray = $.map(countries, function(value, key) {
  752. return {
  753. value: value,
  754. data: key
  755. };
  756. });
  757. // initialize autocomplete with custom appendTo
  758. $('#autocomplete-custom-append').autocomplete({
  759. lookup: countriesArray
  760. });
  761. };
  762. /* AUTOSIZE */
  763. function init_autosize() {
  764. if(typeof $.fn.autosize !== 'undefined'){
  765. autosize($('.resizable_textarea'));
  766. }
  767. };
  768. /* PARSLEY */
  769. function init_parsley() {
  770. if( typeof (parsley) === 'undefined'){ return; }
  771. console.log('init_parsley');
  772. $/*.listen*/('parsley:field:validate', function() {
  773. validateFront();
  774. });
  775. $('#demo-form .btn').on('click', function() {
  776. $('#demo-form').parsley().validate();
  777. validateFront();
  778. });
  779. var validateFront = function() {
  780. if (true === $('#demo-form').parsley().isValid()) {
  781. $('.bs-callout-info').removeClass('hidden');
  782. $('.bs-callout-warning').addClass('hidden');
  783. } else {
  784. $('.bs-callout-info').addClass('hidden');
  785. $('.bs-callout-warning').removeClass('hidden');
  786. }
  787. };
  788. $/*.listen*/('parsley:field:validate', function() {
  789. validateFront();
  790. });
  791. $('#demo-form2 .btn').on('click', function() {
  792. $('#demo-form2').parsley().validate();
  793. validateFront();
  794. });
  795. var validateFront = function() {
  796. if (true === $('#demo-form2').parsley().isValid()) {
  797. $('.bs-callout-info').removeClass('hidden');
  798. $('.bs-callout-warning').addClass('hidden');
  799. } else {
  800. $('.bs-callout-info').addClass('hidden');
  801. $('.bs-callout-warning').removeClass('hidden');
  802. }
  803. };
  804. try {
  805. hljs.initHighlightingOnLoad();
  806. } catch (err) {}
  807. };
  808. /* INPUTS */
  809. function onAddTag(tag) {
  810. alert("Added a tag: " + tag);
  811. }
  812. function onRemoveTag(tag) {
  813. alert("Removed a tag: " + tag);
  814. }
  815. function onChangeTag(input, tag) {
  816. alert("Changed a tag: " + tag);
  817. }
  818. //tags input
  819. function init_TagsInput() {
  820. if(typeof $.fn.tagsInput !== 'undefined'){
  821. $('#tags_1').tagsInput({
  822. width: 'auto'
  823. });
  824. }
  825. };
  826. /* SELECT2 */
  827. function init_select2() {
  828. if( typeof (select2) === 'undefined'){ return; }
  829. console.log('init_toolbox');
  830. $(".select2_single").select2({
  831. placeholder: "Select a state",
  832. allowClear: true
  833. });
  834. $(".select2_group").select2({});
  835. $(".select2_multiple").select2({
  836. maximumSelectionLength: 4,
  837. placeholder: "With Max Selection limit 4",
  838. allowClear: true
  839. });
  840. };
  841. /* WYSIWYG EDITOR */
  842. function init_wysiwyg() {
  843. if( typeof ($.fn.wysiwyg) === 'undefined'){ return; }
  844. console.log('init_wysiwyg');
  845. function init_ToolbarBootstrapBindings() {
  846. var fonts = ['Serif', 'Sans', 'Arial', 'Arial Black', 'Courier',
  847. 'Courier New', 'Comic Sans MS', 'Helvetica', 'Impact', 'Lucida Grande', 'Lucida Sans', 'Tahoma', 'Times',
  848. 'Times New Roman', 'Verdana'
  849. ],
  850. fontTarget = $('[title=Font]').siblings('.dropdown-menu');
  851. $.each(fonts, function(idx, fontName) {
  852. fontTarget.append($('<li><a data-edit="fontName ' + fontName + '" style="font-family:\'' + fontName + '\'">' + fontName + '</a></li>'));
  853. });
  854. $('a[title]').tooltip({
  855. container: 'body'
  856. });
  857. $('.dropdown-menu input').click(function() {
  858. return false;
  859. })
  860. .change(function() {
  861. $(this).parent('.dropdown-menu').siblings('.dropdown-toggle').dropdown('toggle');
  862. })
  863. .keydown('esc', function() {
  864. this.value = '';
  865. $(this).change();
  866. });
  867. $('[data-role=magic-overlay]').each(function() {
  868. var overlay = $(this),
  869. target = $(overlay.data('target'));
  870. overlay.css('opacity', 0).css('position', 'absolute').offset(target.offset()).width(target.outerWidth()).height(target.outerHeight());
  871. });
  872. if ("onwebkitspeechchange" in document.createElement("input")) {
  873. var editorOffset = $('#editor').offset();
  874. $('.voiceBtn').css('position', 'absolute').offset({
  875. top: editorOffset.top,
  876. left: editorOffset.left + $('#editor').innerWidth() - 35
  877. });
  878. } else {
  879. $('.voiceBtn').hide();
  880. }
  881. }
  882. function showErrorAlert(reason, detail) {
  883. var msg = '';
  884. if (reason === 'unsupported-file-type') {
  885. msg = "Unsupported format " + detail;
  886. } else {
  887. console.log("error uploading file", reason, detail);
  888. }
  889. $('<div class="alert"> <button type="button" class="close" data-dismiss="alert">&times;</button>' +
  890. '<strong>File upload error</strong> ' + msg + ' </div>').prependTo('#alerts');
  891. }
  892. $('.editor-wrapper').each(function(){
  893. var id = $(this).attr('id'); //editor-one
  894. $(this).wysiwyg({
  895. toolbarSelector: '[data-target="#' + id + '"]',
  896. fileUploadError: showErrorAlert
  897. });
  898. });
  899. window.prettyPrint;
  900. prettyPrint();
  901. };
  902. /* CROPPER */
  903. function init_cropper() {
  904. if( typeof ($.fn.cropper) === 'undefined'){ return; }
  905. console.log('init_cropper');
  906. var $image = $('#image');
  907. var $download = $('#download');
  908. var $dataX = $('#dataX');
  909. var $dataY = $('#dataY');
  910. var $dataHeight = $('#dataHeight');
  911. var $dataWidth = $('#dataWidth');
  912. var $dataRotate = $('#dataRotate');
  913. var $dataScaleX = $('#dataScaleX');
  914. var $dataScaleY = $('#dataScaleY');
  915. var options = {
  916. aspectRatio: 16 / 9,
  917. preview: '.img-preview',
  918. crop: function (e) {
  919. $dataX.val(Math.round(e.x));
  920. $dataY.val(Math.round(e.y));
  921. $dataHeight.val(Math.round(e.height));
  922. $dataWidth.val(Math.round(e.width));
  923. $dataRotate.val(e.rotate);
  924. $dataScaleX.val(e.scaleX);
  925. $dataScaleY.val(e.scaleY);
  926. }
  927. };
  928. // Tooltip
  929. $('[data-toggle="tooltip"]').tooltip();
  930. // Cropper
  931. $image.on({
  932. 'build.cropper': function (e) {
  933. console.log(e.type);
  934. },
  935. 'built.cropper': function (e) {
  936. console.log(e.type);
  937. },
  938. 'cropstart.cropper': function (e) {
  939. console.log(e.type, e.action);
  940. },
  941. 'cropmove.cropper': function (e) {
  942. console.log(e.type, e.action);
  943. },
  944. 'cropend.cropper': function (e) {
  945. console.log(e.type, e.action);
  946. },
  947. 'crop.cropper': function (e) {
  948. console.log(e.type, e.x, e.y, e.width, e.height, e.rotate, e.scaleX, e.scaleY);
  949. },
  950. 'zoom.cropper': function (e) {
  951. console.log(e.type, e.ratio);
  952. }
  953. }).cropper(options);
  954. // Buttons
  955. if (!$.isFunction(document.createElement('canvas').getContext)) {
  956. $('button[data-method="getCroppedCanvas"]').prop('disabled', true);
  957. }
  958. if (typeof document.createElement('cropper').style.transition === 'undefined') {
  959. $('button[data-method="rotate"]').prop('disabled', true);
  960. $('button[data-method="scale"]').prop('disabled', true);
  961. }
  962. // Download
  963. if (typeof $download[0].download === 'undefined') {
  964. $download.addClass('disabled');
  965. }
  966. // Options
  967. $('.docs-toggles').on('change', 'input', function () {
  968. var $this = $(this);
  969. var name = $this.attr('name');
  970. var type = $this.prop('type');
  971. var cropBoxData;
  972. var canvasData;
  973. if (!$image.data('cropper')) {
  974. return;
  975. }
  976. if (type === 'checkbox') {
  977. options[name] = $this.prop('checked');
  978. cropBoxData = $image.cropper('getCropBoxData');
  979. canvasData = $image.cropper('getCanvasData');
  980. options.built = function () {
  981. $image.cropper('setCropBoxData', cropBoxData);
  982. $image.cropper('setCanvasData', canvasData);
  983. };
  984. } else if (type === 'radio') {
  985. options[name] = $this.val();
  986. }
  987. $image.cropper('destroy').cropper(options);
  988. });
  989. // Methods
  990. $('.docs-buttons').on('click', '[data-method]', function () {
  991. var $this = $(this);
  992. var data = $this.data();
  993. var $target;
  994. var result;
  995. if ($this.prop('disabled') || $this.hasClass('disabled')) {
  996. return;
  997. }
  998. if ($image.data('cropper') && data.method) {
  999. data = $.extend({}, data); // Clone a new one
  1000. if (typeof data.target !== 'undefined') {
  1001. $target = $(data.target);
  1002. if (typeof data.option === 'undefined') {
  1003. try {
  1004. data.option = JSON.parse($target.val());
  1005. } catch (e) {
  1006. console.log(e.message);
  1007. }
  1008. }
  1009. }
  1010. result = $image.cropper(data.method, data.option, data.secondOption);
  1011. switch (data.method) {
  1012. case 'scaleX':
  1013. case 'scaleY':
  1014. $(this).data('option', -data.option);
  1015. break;
  1016. case 'getCroppedCanvas':
  1017. if (result) {
  1018. // Bootstrap's Modal
  1019. $('#getCroppedCanvasModal').modal().find('.modal-body').html(result);
  1020. if (!$download.hasClass('disabled')) {
  1021. $download.attr('href', result.toDataURL());
  1022. }
  1023. }
  1024. break;
  1025. }
  1026. if ($.isPlainObject(result) && $target) {
  1027. try {
  1028. $target.val(JSON.stringify(result));
  1029. } catch (e) {
  1030. console.log(e.message);
  1031. }
  1032. }
  1033. }
  1034. });
  1035. // Keyboard
  1036. $(document.body).on('keydown', function (e) {
  1037. if (!$image.data('cropper') || this.scrollTop > 300) {
  1038. return;
  1039. }
  1040. switch (e.which) {
  1041. case 37:
  1042. e.preventDefault();
  1043. $image.cropper('move', -1, 0);
  1044. break;
  1045. case 38:
  1046. e.preventDefault();
  1047. $image.cropper('move', 0, -1);
  1048. break;
  1049. case 39:
  1050. e.preventDefault();
  1051. $image.cropper('move', 1, 0);
  1052. break;
  1053. case 40:
  1054. e.preventDefault();
  1055. $image.cropper('move', 0, 1);
  1056. break;
  1057. }
  1058. });
  1059. // Import image
  1060. var $inputImage = $('#inputImage');
  1061. var URL = window.URL || window.webkitURL;
  1062. var blobURL;
  1063. if (URL) {
  1064. $inputImage.change(function () {
  1065. var files = this.files;
  1066. var file;
  1067. if (!$image.data('cropper')) {
  1068. return;
  1069. }
  1070. if (files && files.length) {
  1071. file = files[0];
  1072. if (/^image\/\w+$/.test(file.type)) {
  1073. blobURL = URL.createObjectURL(file);
  1074. $image.one('built.cropper', function () {
  1075. // Revoke when load complete
  1076. URL.revokeObjectURL(blobURL);
  1077. }).cropper('reset').cropper('replace', blobURL);
  1078. $inputImage.val('');
  1079. } else {
  1080. window.alert('Please choose an image file.');
  1081. }
  1082. }
  1083. });
  1084. } else {
  1085. $inputImage.prop('disabled', true).parent().addClass('disabled');
  1086. }
  1087. };
  1088. /* CROPPER --- end */
  1089. /* KNOB */
  1090. function init_knob() {
  1091. if( typeof ($.fn.knob) === 'undefined'){ return; }
  1092. console.log('init_knob');
  1093. $(".knob").knob({
  1094. change: function(value) {
  1095. //console.log("change : " + value);
  1096. },
  1097. release: function(value) {
  1098. //console.log(this.$.attr('value'));
  1099. console.log("release : " + value);
  1100. },
  1101. cancel: function() {
  1102. console.log("cancel : ", this);
  1103. },
  1104. /*format : function (value) {
  1105. return value + '%';
  1106. },*/
  1107. draw: function() {
  1108. // "tron" case
  1109. if (this.$.data('skin') == 'tron') {
  1110. this.cursorExt = 0.3;
  1111. var a = this.arc(this.cv) // Arc
  1112. ,
  1113. pa // Previous arc
  1114. , r = 1;
  1115. this.g.lineWidth = this.lineWidth;
  1116. if (this.o.displayPrevious) {
  1117. pa = this.arc(this.v);
  1118. this.g.beginPath();
  1119. this.g.strokeStyle = this.pColor;
  1120. this.g.arc(this.xy, this.xy, this.radius - this.lineWidth, pa.s, pa.e, pa.d);
  1121. this.g.stroke();
  1122. }
  1123. this.g.beginPath();
  1124. this.g.strokeStyle = r ? this.o.fgColor : this.fgColor;
  1125. this.g.arc(this.xy, this.xy, this.radius - this.lineWidth, a.s, a.e, a.d);
  1126. this.g.stroke();
  1127. this.g.lineWidth = 2;
  1128. this.g.beginPath();
  1129. this.g.strokeStyle = this.o.fgColor;
  1130. this.g.arc(this.xy, this.xy, this.radius - this.lineWidth + 1 + this.lineWidth * 2 / 3, 0, 2 * Math.PI, false);
  1131. this.g.stroke();
  1132. return false;
  1133. }
  1134. }
  1135. });
  1136. // Example of infinite knob, iPod click wheel
  1137. var v, up = 0,
  1138. down = 0,
  1139. i = 0,
  1140. $idir = $("div.idir"),
  1141. $ival = $("div.ival"),
  1142. incr = function() {
  1143. i++;
  1144. $idir.show().html("+").fadeOut();
  1145. $ival.html(i);
  1146. },
  1147. decr = function() {
  1148. i--;
  1149. $idir.show().html("-").fadeOut();
  1150. $ival.html(i);
  1151. };
  1152. $("input.infinite").knob({
  1153. min: 0,
  1154. max: 20,
  1155. stopper: false,
  1156. change: function() {
  1157. if (v > this.cv) {
  1158. if (up) {
  1159. decr();
  1160. up = 0;
  1161. } else {
  1162. up = 1;
  1163. down = 0;
  1164. }
  1165. } else {
  1166. if (v < this.cv) {
  1167. if (down) {
  1168. incr();
  1169. down = 0;
  1170. } else {
  1171. down = 1;
  1172. up = 0;
  1173. }
  1174. }
  1175. }
  1176. v = this.cv;
  1177. }
  1178. });
  1179. };
  1180. /* INPUT MASK */
  1181. function init_InputMask() {
  1182. if( typeof ($.fn.inputmask) === 'undefined'){ return; }
  1183. console.log('init_InputMask');
  1184. $(":input").inputmask();
  1185. };
  1186. /* COLOR PICKER */
  1187. function init_ColorPicker() {
  1188. if( typeof ($.fn.colorpicker) === 'undefined'){ return; }
  1189. console.log('init_ColorPicker');
  1190. $('.demo1').colorpicker();
  1191. $('.demo2').colorpicker();
  1192. $('#demo_forceformat').colorpicker({
  1193. format: 'rgba',
  1194. horizontal: true
  1195. });
  1196. $('#demo_forceformat3').colorpicker({
  1197. format: 'rgba',
  1198. });
  1199. $('.demo-auto').colorpicker();
  1200. };
  1201. /* ION RANGE SLIDER */
  1202. function init_IonRangeSlider() {
  1203. if( typeof ($.fn.ionRangeSlider) === 'undefined'){ return; }
  1204. console.log('init_IonRangeSlider');
  1205. $("#range_27").ionRangeSlider({
  1206. type: "double",
  1207. min: 1000000,
  1208. max: 2000000,
  1209. grid: true,
  1210. force_edges: true
  1211. });
  1212. $("#range").ionRangeSlider({
  1213. hide_min_max: true,
  1214. keyboard: true,
  1215. min: 0,
  1216. max: 5000,
  1217. from: 1000,
  1218. to: 4000,
  1219. type: 'double',
  1220. step: 1,
  1221. prefix: "$",
  1222. grid: true
  1223. });
  1224. $("#range_25").ionRangeSlider({
  1225. type: "double",
  1226. min: 1000000,
  1227. max: 2000000,
  1228. grid: true
  1229. });
  1230. $("#range_26").ionRangeSlider({
  1231. type: "double",
  1232. min: 0,
  1233. max: 10000,
  1234. step: 500,
  1235. grid: true,
  1236. grid_snap: true
  1237. });
  1238. $("#range_31").ionRangeSlider({
  1239. type: "double",
  1240. min: 0,
  1241. max: 100,
  1242. from: 30,
  1243. to: 70,
  1244. from_fixed: true
  1245. });
  1246. $(".range_min_max").ionRangeSlider({
  1247. type: "double",
  1248. min: 0,
  1249. max: 100,
  1250. from: 30,
  1251. to: 70,
  1252. max_interval: 50
  1253. });
  1254. $(".range_time24").ionRangeSlider({
  1255. min: +moment().subtract(12, "hours").format("X"),
  1256. max: +moment().format("X"),
  1257. from: +moment().subtract(6, "hours").format("X"),
  1258. grid: true,
  1259. force_edges: true,
  1260. prettify: function(num) {
  1261. var m = moment(num, "X");
  1262. return m.format("Do MMMM, HH:mm");
  1263. }
  1264. });
  1265. };
  1266. /* DATERANGEPICKER */
  1267. function init_daterangepicker() {
  1268. if( typeof ($.fn.daterangepicker) === 'undefined'){ return; }
  1269. console.log('init_daterangepicker');
  1270. var cb = function(start, end, label) {
  1271. console.log(start.toISOString(), end.toISOString(), label);
  1272. $('#reportrange span').html(start.format('MMMM D, YYYY') + ' - ' + end.format('MMMM D, YYYY'));
  1273. };
  1274. var optionSet1 = {
  1275. startDate: moment().subtract(29, 'days'),
  1276. endDate: moment(),
  1277. minDate: '01/01/2012',
  1278. maxDate: '12/31/2015',
  1279. dateLimit: {
  1280. days: 60
  1281. },
  1282. showDropdowns: true,
  1283. showWeekNumbers: true,
  1284. timePicker: false,
  1285. timePickerIncrement: 1,
  1286. timePicker12Hour: true,
  1287. ranges: {
  1288. 'Today': [moment(), moment()],
  1289. 'Yesterday': [moment().subtract(1, 'days'), moment().subtract(1, 'days')],
  1290. 'Last 7 Days': [moment().subtract(6, 'days'), moment()],
  1291. 'Last 30 Days': [moment().subtract(29, 'days'), moment()],
  1292. 'This Month': [moment().startOf('month'), moment().endOf('month')],
  1293. 'Last Month': [moment().subtract(1, 'month').startOf('month'), moment().subtract(1, 'month').endOf('month')]
  1294. },
  1295. opens: 'left',
  1296. buttonClasses: ['btn btn-default'],
  1297. applyClass: 'btn-small btn-primary',
  1298. cancelClass: 'btn-small',
  1299. format: 'MM/DD/YYYY',
  1300. separator: ' to ',
  1301. locale: {
  1302. applyLabel: 'Submit',
  1303. cancelLabel: 'Clear',
  1304. fromLabel: 'From',
  1305. toLabel: 'To',
  1306. customRangeLabel: 'Custom',
  1307. daysOfWeek: ['Su', 'Mo', 'Tu', 'We', 'Th', 'Fr', 'Sa'],
  1308. monthNames: ['January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December'],
  1309. firstDay: 1
  1310. }
  1311. };
  1312. $('#reportrange span').html(moment().subtract(29, 'days').format('MMMM D, YYYY') + ' - ' + moment().format('MMMM D, YYYY'));
  1313. $('#reportrange').daterangepicker(optionSet1, cb);
  1314. $('#reportrange').on('show.daterangepicker', function() {
  1315. console.log("show event fired");
  1316. });
  1317. $('#reportrange').on('hide.daterangepicker', function() {
  1318. console.log("hide event fired");
  1319. });
  1320. $('#reportrange').on('apply.daterangepicker', function(ev, picker) {
  1321. console.log("apply event fired, start/end dates are " + picker.startDate.format('MMMM D, YYYY') + " to " + picker.endDate.format('MMMM D, YYYY'));
  1322. });
  1323. $('#reportrange').on('cancel.daterangepicker', function(ev, picker) {
  1324. console.log("cancel event fired");
  1325. });
  1326. $('#options1').click(function() {
  1327. $('#reportrange').data('daterangepicker').setOptions(optionSet1, cb);
  1328. });
  1329. $('#options2').click(function() {
  1330. $('#reportrange').data('daterangepicker').setOptions(optionSet2, cb);
  1331. });
  1332. $('#destroy').click(function() {
  1333. $('#reportrange').data('daterangepicker').remove();
  1334. });
  1335. }
  1336. function init_daterangepicker_right() {
  1337. if( typeof ($.fn.daterangepicker) === 'undefined'){ return; }
  1338. console.log('init_daterangepicker_right');
  1339. var cb = function(start, end, label) {
  1340. console.log(start.toISOString(), end.toISOString(), label);
  1341. $('#reportrange_right span').html(start.format('MMMM D, YYYY') + ' - ' + end.format('MMMM D, YYYY'));
  1342. };
  1343. var optionSet1 = {
  1344. startDate: moment().subtract(29, 'days'),
  1345. endDate: moment(),
  1346. minDate: '01/01/2012',
  1347. maxDate: '12/31/2020',
  1348. dateLimit: {
  1349. days: 60
  1350. },
  1351. showDropdowns: true,
  1352. showWeekNumbers: true,
  1353. timePicker: false,
  1354. timePickerIncrement: 1,
  1355. timePicker12Hour: true,
  1356. ranges: {
  1357. 'Today': [moment(), moment()],
  1358. 'Yesterday': [moment().subtract(1, 'days'), moment().subtract(1, 'days')],
  1359. 'Last 7 Days': [moment().subtract(6, 'days'), moment()],
  1360. 'Last 30 Days': [moment().subtract(29, 'days'), moment()],
  1361. 'This Month': [moment().startOf('month'), moment().endOf('month')],
  1362. 'Last Month': [moment().subtract(1, 'month').startOf('month'), moment().subtract(1, 'month').endOf('month')]
  1363. },
  1364. opens: 'right',
  1365. buttonClasses: ['btn btn-default'],
  1366. applyClass: 'btn-small btn-primary',
  1367. cancelClass: 'btn-small',
  1368. format: 'MM/DD/YYYY',
  1369. separator: ' to ',
  1370. locale: {
  1371. applyLabel: 'Submit',
  1372. cancelLabel: 'Clear',
  1373. fromLabel: 'From',
  1374. toLabel: 'To',
  1375. customRangeLabel: 'Custom',
  1376. daysOfWeek: ['Su', 'Mo', 'Tu', 'We', 'Th', 'Fr', 'Sa'],
  1377. monthNames: ['January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December'],
  1378. firstDay: 1
  1379. }
  1380. };
  1381. $('#reportrange_right span').html(moment().subtract(29, 'days').format('MMMM D, YYYY') + ' - ' + moment().format('MMMM D, YYYY'));
  1382. $('#reportrange_right').daterangepicker(optionSet1, cb);
  1383. $('#reportrange_right').on('show.daterangepicker', function() {
  1384. console.log("show event fired");
  1385. });
  1386. $('#reportrange_right').on('hide.daterangepicker', function() {
  1387. console.log("hide event fired");
  1388. });
  1389. $('#reportrange_right').on('apply.daterangepicker', function(ev, picker) {
  1390. console.log("apply event fired, start/end dates are " + picker.startDate.format('MMMM D, YYYY') + " to " + picker.endDate.format('MMMM D, YYYY'));
  1391. });
  1392. $('#reportrange_right').on('cancel.daterangepicker', function(ev, picker) {
  1393. console.log("cancel event fired");
  1394. });
  1395. $('#options1').click(function() {
  1396. $('#reportrange_right').data('daterangepicker').setOptions(optionSet1, cb);
  1397. });
  1398. $('#options2').click(function() {
  1399. $('#reportrange_right').data('daterangepicker').setOptions(optionSet2, cb);
  1400. });
  1401. $('#destroy').click(function() {
  1402. $('#reportrange_right').data('daterangepicker').remove();
  1403. });
  1404. }
  1405. function init_daterangepicker_single_call() {
  1406. if( typeof ($.fn.daterangepicker) === 'undefined'){ return; }
  1407. console.log('init_daterangepicker_single_call');
  1408. $('#single_cal1').daterangepicker({
  1409. singleDatePicker: true,
  1410. singleClasses: "picker_1"
  1411. }, function(start, end, label) {
  1412. console.log(start.toISOString(), end.toISOString(), label);
  1413. });
  1414. $('#single_cal2').daterangepicker({
  1415. singleDatePicker: true,
  1416. singleClasses: "picker_2"
  1417. }, function(start, end, label) {
  1418. console.log(start.toISOString(), end.toISOString(), label);
  1419. });
  1420. $('#single_cal3').daterangepicker({
  1421. singleDatePicker: true,
  1422. singleClasses: "picker_3"
  1423. }, function(start, end, label) {
  1424. console.log(start.toISOString(), end.toISOString(), label);
  1425. });
  1426. $('#single_cal4').daterangepicker({
  1427. singleDatePicker: true,
  1428. singleClasses: "picker_4"
  1429. }, function(start, end, label) {
  1430. console.log(start.toISOString(), end.toISOString(), label);
  1431. });
  1432. }
  1433. function init_daterangepicker_reservation() {
  1434. if( typeof ($.fn.daterangepicker) === 'undefined'){ return; }
  1435. console.log('init_daterangepicker_reservation');
  1436. $('#reservation').daterangepicker(null, function(start, end, label) {
  1437. console.log(start.toISOString(), end.toISOString(), label);
  1438. });
  1439. $('#reservation-time').daterangepicker({
  1440. timePicker: true,
  1441. timePickerIncrement: 30,
  1442. locale: {
  1443. format: 'MM/DD/YYYY h:mm A'
  1444. }
  1445. });
  1446. }
  1447. /* SMART WIZARD */
  1448. function init_SmartWizard() {
  1449. if( typeof ($.fn.smartWizard) === 'undefined'){ return; }
  1450. console.log('init_SmartWizard');
  1451. $('#wizard').smartWizard();
  1452. $('#wizard_verticle').smartWizard({
  1453. transitionEffect: 'slide'
  1454. });
  1455. $('.buttonNext').addClass('btn btn-success');
  1456. $('.buttonPrevious').addClass('btn btn-primary');
  1457. $('.buttonFinish').addClass('btn btn-default');
  1458. };
  1459. /* VALIDATOR */
  1460. function init_validator () {
  1461. if( typeof (validator) === 'undefined'){ return; }
  1462. console.log('init_validator');
  1463. // initialize the validator function
  1464. validator.message.date = 'not a real date';
  1465. // validate a field on "blur" event, a 'select' on 'change' event & a '.reuired' classed multifield on 'keyup':
  1466. $('form')
  1467. .on('blur', 'input[required], input.optional, select.required', validator.checkField)
  1468. .on('change', 'select.required', validator.checkField)
  1469. .on('keypress', 'input[required][pattern]', validator.keypress);
  1470. $('.multi.required').on('keyup blur', 'input', function() {
  1471. validator.checkField.apply($(this).siblings().last()[0]);
  1472. });
  1473. $('form').submit(function(e) {
  1474. e.preventDefault();
  1475. var submit = true;
  1476. // evaluate the form using generic validaing
  1477. if (!validator.checkAll($(this))) {
  1478. submit = false;
  1479. }
  1480. if (submit)
  1481. this.submit();
  1482. return false;
  1483. });
  1484. };
  1485. /* PNotify */
  1486. function init_PNotify() {
  1487. if( typeof (PNotify) === 'undefined'){ return; }
  1488. console.log('init_PNotify');
  1489. new PNotify({
  1490. title: "PNotify",
  1491. type: "info",
  1492. text: "Welcome. Try hovering over me. You can click things behind me, because I'm non-blocking.",
  1493. nonblock: {
  1494. nonblock: true
  1495. },
  1496. addclass: 'dark',
  1497. styling: 'bootstrap3',
  1498. hide: false,
  1499. before_close: function(PNotify) {
  1500. PNotify.update({
  1501. title: PNotify.options.title + " - Enjoy your Stay",
  1502. before_close: null
  1503. });
  1504. PNotify.queueRemove();
  1505. return false;
  1506. }
  1507. });
  1508. };
  1509. /* CUSTOM NOTIFICATION */
  1510. function init_CustomNotification() {
  1511. console.log('run_customtabs');
  1512. if( typeof (CustomTabs) === 'undefined'){ return; }
  1513. console.log('init_CustomTabs');
  1514. var cnt = 10;
  1515. TabbedNotification = function(options) {
  1516. var message = "<div id='ntf" + cnt + "' class='text alert-" + options.type + "' style='display:none'><h2><i class='fa fa-bell'></i> " + options.title +
  1517. "</h2><div class='close'><a href='javascript:;' class='notification_close'><i class='fa fa-close'></i></a></div><p>" + options.text + "</p></div>";
  1518. if (!document.getElementById('custom_notifications')) {
  1519. alert('doesnt exists');
  1520. } else {
  1521. $('#custom_notifications ul.notifications').append("<li><a id='ntlink" + cnt + "' class='alert-" + options.type + "' href='#ntf" + cnt + "'><i class='fa fa-bell animated shake'></i></a></li>");
  1522. $('#custom_notifications #notif-group').append(message);
  1523. cnt++;
  1524. CustomTabs(options);
  1525. }
  1526. };
  1527. CustomTabs = function(options) {
  1528. $('.tabbed_notifications > div').hide();
  1529. $('.tabbed_notifications > div:first-of-type').show();
  1530. $('#custom_notifications').removeClass('dsp_none');
  1531. $('.notifications a').click(function(e) {
  1532. e.preventDefault();
  1533. var $this = $(this),
  1534. tabbed_notifications = '#' + $this.parents('.notifications').data('tabbed_notifications'),
  1535. others = $this.closest('li').siblings().children('a'),
  1536. target = $this.attr('href');
  1537. others.removeClass('active');
  1538. $this.addClass('active');
  1539. $(tabbed_notifications).children('div').hide();
  1540. $(target).show();
  1541. });
  1542. };
  1543. CustomTabs();
  1544. var tabid = idname = '';
  1545. $(document).on('click', '.notification_close', function(e) {
  1546. idname = $(this).parent().parent().attr("id");
  1547. tabid = idname.substr(-2);
  1548. $('#ntf' + tabid).remove();
  1549. $('#ntlink' + tabid).parent().remove();
  1550. $('.notifications a').first().addClass('active');
  1551. $('#notif-group div').first().css('display', 'block');
  1552. });
  1553. };
  1554. /* EASYPIECHART */
  1555. function init_EasyPieChart() {
  1556. if( typeof ($.fn.easyPieChart) === 'undefined'){ return; }
  1557. console.log('init_EasyPieChart');
  1558. $('.chart').easyPieChart({
  1559. easing: 'easeOutElastic',
  1560. delay: 3000,
  1561. barColor: '#26B99A',
  1562. trackColor: '#fff',
  1563. scaleColor: false,
  1564. lineWidth: 20,
  1565. trackWidth: 16,
  1566. lineCap: 'butt',
  1567. onStep: function(from, to, percent) {
  1568. $(this.el).find('.percent').text(Math.round(percent));
  1569. }
  1570. });
  1571. var chart = window.chart = $('.chart').data('easyPieChart');
  1572. $('.js_update').on('click', function() {
  1573. chart.update(Math.random() * 200 - 100);
  1574. });
  1575. //hover and retain popover when on popover content
  1576. var originalLeave = $.fn.popover.Constructor.prototype.leave;
  1577. $.fn.popover.Constructor.prototype.leave = function(obj) {
  1578. var self = obj instanceof this.constructor ?
  1579. obj : $(obj.currentTarget)[this.type](this.getDelegateOptions()).data('bs.' + this.type);
  1580. var container, timeout;
  1581. originalLeave.call(this, obj);
  1582. if (obj.currentTarget) {
  1583. container = $(obj.currentTarget).siblings('.popover');
  1584. timeout = self.timeout;
  1585. container.one('mouseenter', function() {
  1586. //We entered the actual popover – call off the dogs
  1587. clearTimeout(timeout);
  1588. //Let's monitor popover content instead
  1589. container.one('mouseleave', function() {
  1590. $.fn.popover.Constructor.prototype.leave.call(self, self);
  1591. });
  1592. });
  1593. }
  1594. };
  1595. $('body').popover({
  1596. selector: '[data-popover]',
  1597. trigger: 'click hover',
  1598. delay: {
  1599. show: 50,
  1600. hide: 400
  1601. }
  1602. });
  1603. };
  1604. function init_charts() {
  1605. }
  1606. /*
  1607. console.log('run_charts typeof [' + typeof (Chart) + ']');
  1608. if( typeof (Chart) === 'undefined'){ return; }
  1609. console.log('init_charts');
  1610. Chart.defaults.global.legend = {
  1611. enabled: true
  1612. };
  1613. if ($('#canvas_line').length ){
  1614. var canvas_line_00 = new Chart(document.getElementById("canvas_line"), {
  1615. type: 'line',
  1616. data: {
  1617. labels: ["January", "February", "March", "April", "May", "June", "July"],
  1618. datasets: [{
  1619. label: "My First dataset",
  1620. backgroundColor: "rgba(38, 185, 154, 0.31)",
  1621. borderColor: "rgba(38, 185, 154, 0.7)",
  1622. pointBorderColor: "rgba(38, 185, 154, 0.7)",
  1623. pointBackgroundColor: "rgba(38, 185, 154, 0.7)",
  1624. pointHoverBackgroundColor: "#fff",
  1625. pointHoverBorderColor: "rgba(220,220,220,1)",
  1626. pointBorderWidth: 1,
  1627. data: [31, 74, 6, 39, 20, 85, 7]
  1628. }, {
  1629. label: "My Second dataset",
  1630. backgroundColor: "rgba(3, 88, 106, 0.3)",
  1631. borderColor: "rgba(3, 88, 106, 0.70)",
  1632. pointBorderColor: "rgba(3, 88, 106, 0.70)",
  1633. pointBackgroundColor: "rgba(3, 88, 106, 0.70)",
  1634. pointHoverBackgroundColor: "#fff",
  1635. pointHoverBorderColor: "rgba(151,187,205,1)",
  1636. pointBorderWidth: 1,
  1637. data: [82, 23, 66, 9, 99, 4, 2]
  1638. }]
  1639. },
  1640. });
  1641. }
  1642. if ($('#canvas_line1').length ){
  1643. var canvas_line_01 = new Chart(document.getElementById("canvas_line1"), {
  1644. type: 'line',
  1645. data: {
  1646. labels: ["January", "February", "March", "April", "May", "June", "July"],
  1647. datasets: [{
  1648. label: "My First dataset",
  1649. backgroundColor: "rgba(38, 185, 154, 0.31)",
  1650. borderColor: "rgba(38, 185, 154, 0.7)",
  1651. pointBorderColor: "rgba(38, 185, 154, 0.7)",
  1652. pointBackgroundColor: "rgba(38, 185, 154, 0.7)",
  1653. pointHoverBackgroundColor: "#fff",
  1654. pointHoverBorderColor: "rgba(220,220,220,1)",
  1655. pointBorderWidth: 1,
  1656. data: [31, 74, 6, 39, 20, 85, 7]
  1657. }, {
  1658. label: "My Second dataset",
  1659. backgroundColor: "rgba(3, 88, 106, 0.3)",
  1660. borderColor: "rgba(3, 88, 106, 0.70)",
  1661. pointBorderColor: "rgba(3, 88, 106, 0.70)",
  1662. pointBackgroundColor: "rgba(3, 88, 106, 0.70)",
  1663. pointHoverBackgroundColor: "#fff",
  1664. pointHoverBorderColor: "rgba(151,187,205,1)",
  1665. pointBorderWidth: 1,
  1666. data: [82, 23, 66, 9, 99, 4, 2]
  1667. }]
  1668. },
  1669. });
  1670. }
  1671. if ($('#canvas_line2').length ){
  1672. var canvas_line_02 = new Chart(document.getElementById("canvas_line2"), {
  1673. type: 'line',
  1674. data: {
  1675. labels: ["January", "February", "March", "April", "May", "June", "July"],
  1676. datasets: [{
  1677. label: "My First dataset",
  1678. backgroundColor: "rgba(38, 185, 154, 0.31)",
  1679. borderColor: "rgba(38, 185, 154, 0.7)",
  1680. pointBorderColor: "rgba(38, 185, 154, 0.7)",
  1681. pointBackgroundColor: "rgba(38, 185, 154, 0.7)",
  1682. pointHoverBackgroundColor: "#fff",
  1683. pointHoverBorderColor: "rgba(220,220,220,1)",
  1684. pointBorderWidth: 1,
  1685. data: [31, 74, 6, 39, 20, 85, 7]
  1686. }, {
  1687. label: "My Second dataset",
  1688. backgroundColor: "rgba(3, 88, 106, 0.3)",
  1689. borderColor: "rgba(3, 88, 106, 0.70)",
  1690. pointBorderColor: "rgba(3, 88, 106, 0.70)",
  1691. pointBackgroundColor: "rgba(3, 88, 106, 0.70)",
  1692. pointHoverBackgroundColor: "#fff",
  1693. pointHoverBorderColor: "rgba(151,187,205,1)",
  1694. pointBorderWidth: 1,
  1695. data: [82, 23, 66, 9, 99, 4, 2]
  1696. }]
  1697. },
  1698. });
  1699. }
  1700. if ($('#canvas_line3').length ){
  1701. var canvas_line_03 = new Chart(document.getElementById("canvas_line3"), {
  1702. type: 'line',
  1703. data: {
  1704. labels: ["January", "February", "March", "April", "May", "June", "July"],
  1705. datasets: [{
  1706. label: "My First dataset",
  1707. backgroundColor: "rgba(38, 185, 154, 0.31)",
  1708. borderColor: "rgba(38, 185, 154, 0.7)",
  1709. pointBorderColor: "rgba(38, 185, 154, 0.7)",
  1710. pointBackgroundColor: "rgba(38, 185, 154, 0.7)",
  1711. pointHoverBackgroundColor: "#fff",
  1712. pointHoverBorderColor: "rgba(220,220,220,1)",
  1713. pointBorderWidth: 1,
  1714. data: [31, 74, 6, 39, 20, 85, 7]
  1715. }, {
  1716. label: "My Second dataset",
  1717. backgroundColor: "rgba(3, 88, 106, 0.3)",
  1718. borderColor: "rgba(3, 88, 106, 0.70)",
  1719. pointBorderColor: "rgba(3, 88, 106, 0.70)",
  1720. pointBackgroundColor: "rgba(3, 88, 106, 0.70)",
  1721. pointHoverBackgroundColor: "#fff",
  1722. pointHoverBorderColor: "rgba(151,187,205,1)",
  1723. pointBorderWidth: 1,
  1724. data: [82, 23, 66, 9, 99, 4, 2]
  1725. }]
  1726. },
  1727. });
  1728. }
  1729. if ($('#canvas_line4').length ){
  1730. var canvas_line_04 = new Chart(document.getElementById("canvas_line4"), {
  1731. type: 'line',
  1732. data: {
  1733. labels: ["January", "February", "March", "April", "May", "June", "July"],
  1734. datasets: [{
  1735. label: "My First dataset",
  1736. backgroundColor: "rgba(38, 185, 154, 0.31)",
  1737. borderColor: "rgba(38, 185, 154, 0.7)",
  1738. pointBorderColor: "rgba(38, 185, 154, 0.7)",
  1739. pointBackgroundColor: "rgba(38, 185, 154, 0.7)",
  1740. pointHoverBackgroundColor: "#fff",
  1741. pointHoverBorderColor: "rgba(220,220,220,1)",
  1742. pointBorderWidth: 1,
  1743. data: [31, 74, 6, 39, 20, 85, 7]
  1744. }, {
  1745. label: "My Second dataset",
  1746. backgroundColor: "rgba(3, 88, 106, 0.3)",
  1747. borderColor: "rgba(3, 88, 106, 0.70)",
  1748. pointBorderColor: "rgba(3, 88, 106, 0.70)",
  1749. pointBackgroundColor: "rgba(3, 88, 106, 0.70)",
  1750. pointHoverBackgroundColor: "#fff",
  1751. pointHoverBorderColor: "rgba(151,187,205,1)",
  1752. pointBorderWidth: 1,
  1753. data: [82, 23, 66, 9, 99, 4, 2]
  1754. }]
  1755. },
  1756. });
  1757. }
  1758. // Line chart
  1759. if ($('#lineChart').length ){
  1760. var ctx = document.getElementById("lineChart");
  1761. var lineChart = new Chart(ctx, {
  1762. type: 'line',
  1763. data: {
  1764. labels: ["January", "February", "March", "April", "May", "June", "July"],
  1765. datasets: [{
  1766. label: "My First dataset",
  1767. backgroundColor: "rgba(38, 185, 154, 0.31)",
  1768. borderColor: "rgba(38, 185, 154, 0.7)",
  1769. pointBorderColor: "rgba(38, 185, 154, 0.7)",
  1770. pointBackgroundColor: "rgba(38, 185, 154, 0.7)",
  1771. pointHoverBackgroundColor: "#fff",
  1772. pointHoverBorderColor: "rgba(220,220,220,1)",
  1773. pointBorderWidth: 1,
  1774. data: [31, 74, 6, 39, 20, 85, 7]
  1775. }, {
  1776. label: "My Second dataset",
  1777. backgroundColor: "rgba(3, 88, 106, 0.3)",
  1778. borderColor: "rgba(3, 88, 106, 0.70)",
  1779. pointBorderColor: "rgba(3, 88, 106, 0.70)",
  1780. pointBackgroundColor: "rgba(3, 88, 106, 0.70)",
  1781. pointHoverBackgroundColor: "#fff",
  1782. pointHoverBorderColor: "rgba(151,187,205,1)",
  1783. pointBorderWidth: 1,
  1784. data: [82, 23, 66, 9, 99, 4, 2]
  1785. }]
  1786. },
  1787. });
  1788. }
  1789. // Bar chart
  1790. if ($('#mybarChart').length ){
  1791. var ctx = document.getElementById("mybarChart");
  1792. var mybarChart = new Chart(ctx, {
  1793. type: 'bar',
  1794. data: {
  1795. labels: ["January", "February", "March", "April", "May", "June", "July"],
  1796. datasets: [{
  1797. label: '# of Votes',
  1798. backgroundColor: "#26B99A",
  1799. data: [51, 30, 40, 28, 92, 50, 45]
  1800. }, {
  1801. label: '# of Votes',
  1802. backgroundColor: "#03586A",
  1803. data: [41, 56, 25, 48, 72, 34, 12]
  1804. }]
  1805. },
  1806. options: {
  1807. scales: {
  1808. yAxes: [{
  1809. ticks: {
  1810. beginAtZero: true
  1811. }
  1812. }]
  1813. }
  1814. }
  1815. });
  1816. }
  1817. // Doughnut chart
  1818. if ($('#canvasDoughnut').length ){
  1819. var ctx = document.getElementById("canvasDoughnut");
  1820. var data = {
  1821. labels: [
  1822. "Dark Grey",
  1823. "Purple Color",
  1824. "Gray Color",
  1825. "Green Color",
  1826. "Blue Color"
  1827. ],
  1828. datasets: [{
  1829. data: [120, 50, 140, 180, 100],
  1830. backgroundColor: [
  1831. "#455C73",
  1832. "#9B59B6",
  1833. "#BDC3C7",
  1834. "#26B99A",
  1835. "#3498DB"
  1836. ],
  1837. hoverBackgroundColor: [
  1838. "#34495E",
  1839. "#B370CF",
  1840. "#CFD4D8",
  1841. "#36CAAB",
  1842. "#49A9EA"
  1843. ]
  1844. }]
  1845. };
  1846. var canvasDoughnut = new Chart(ctx, {
  1847. type: 'doughnut',
  1848. tooltipFillColor: "rgba(51, 51, 51, 0.55)",
  1849. data: data
  1850. });
  1851. }
  1852. // Radar chart
  1853. if ($('#canvasRadar').length ){
  1854. var ctx = document.getElementById("canvasRadar");
  1855. var data = {
  1856. labels: ["Eating", "Drinking", "Sleeping", "Designing", "Coding", "Cycling", "Running"],
  1857. datasets: [{
  1858. label: "My First dataset",
  1859. backgroundColor: "rgba(3, 88, 106, 0.2)",
  1860. borderColor: "rgba(3, 88, 106, 0.80)",
  1861. pointBorderColor: "rgba(3, 88, 106, 0.80)",
  1862. pointBackgroundColor: "rgba(3, 88, 106, 0.80)",
  1863. pointHoverBackgroundColor: "#fff",
  1864. pointHoverBorderColor: "rgba(220,220,220,1)",
  1865. data: [65, 59, 90, 81, 56, 55, 40]
  1866. }, {
  1867. label: "My Second dataset",
  1868. backgroundColor: "rgba(38, 185, 154, 0.2)",
  1869. borderColor: "rgba(38, 185, 154, 0.85)",
  1870. pointColor: "rgba(38, 185, 154, 0.85)",
  1871. pointStrokeColor: "#fff",
  1872. pointHighlightFill: "#fff",
  1873. pointHighlightStroke: "rgba(151,187,205,1)",
  1874. data: [28, 48, 40, 19, 96, 27, 100]
  1875. }]
  1876. };
  1877. var canvasRadar = new Chart(ctx, {
  1878. type: 'radar',
  1879. data: data,
  1880. });
  1881. }
  1882. // Pie chart
  1883. if ($('#pieChart').length ){
  1884. var ctx = document.getElementById("pieChart");
  1885. var data = {
  1886. datasets: [{
  1887. data: [120, 50, 140, 180, 100],
  1888. backgroundColor: [
  1889. "#455C73",
  1890. "#9B59B6",
  1891. "#BDC3C7",
  1892. "#26B99A",
  1893. "#3498DB"
  1894. ],
  1895. label: 'My dataset' // for legend
  1896. }],
  1897. labels: [
  1898. "Dark Gray",
  1899. "Purple",
  1900. "Gray",
  1901. "Green",
  1902. "Blue"
  1903. ]
  1904. };
  1905. var pieChart = new Chart(ctx, {
  1906. data: data,
  1907. type: 'pie',
  1908. otpions: {
  1909. legend: false
  1910. }
  1911. });
  1912. }
  1913. // PolarArea chart
  1914. if ($('#polarArea').length ){
  1915. var ctx = document.getElementById("polarArea");
  1916. var data = {
  1917. datasets: [{
  1918. data: [120, 50, 140, 180, 100],
  1919. backgroundColor: [
  1920. "#455C73",
  1921. "#9B59B6",
  1922. "#BDC3C7",
  1923. "#26B99A",
  1924. "#3498DB"
  1925. ],
  1926. label: 'My dataset'
  1927. }],
  1928. labels: [
  1929. "Dark Gray",
  1930. "Purple",
  1931. "Gray",
  1932. "Green",
  1933. "Blue"
  1934. ]
  1935. };
  1936. var polarArea = new Chart(ctx, {
  1937. data: data,
  1938. type: 'polarArea',
  1939. options: {
  1940. scale: {
  1941. ticks: {
  1942. beginAtZero: true
  1943. }
  1944. }
  1945. }
  1946. });
  1947. }
  1948. }*/
  1949. /* COMPOSE */
  1950. function init_compose() {
  1951. if( typeof ($.fn.slideToggle) === 'undefined'){ return; }
  1952. console.log('init_compose');
  1953. $('#compose, .compose-close').click(function(){
  1954. $('.compose').slideToggle();
  1955. });
  1956. };
  1957. /* CALENDAR */
  1958. function init_calendar() {
  1959. if( typeof ($.fn.fullCalendar) === 'undefined'){ return; }
  1960. console.log('init_calendar');
  1961. var date = new Date(),
  1962. d = date.getDate(),
  1963. m = date.getMonth(),
  1964. y = date.getFullYear(),
  1965. started,
  1966. categoryClass;
  1967. var calendar = $('#calendar').fullCalendar({
  1968. header: {
  1969. left: 'prev,next today',
  1970. center: 'title',
  1971. right: 'month,agendaWeek,agendaDay,listMonth'
  1972. },
  1973. selectable: true,
  1974. selectHelper: true,
  1975. select: function(start, end, allDay) {
  1976. $('#fc_create').click();
  1977. started = start;
  1978. ended = end;
  1979. $(".antosubmit").on("click", function() {
  1980. var title = $("#title").val();
  1981. if (end) {
  1982. ended = end;
  1983. }
  1984. categoryClass = $("#event_type").val();
  1985. if (title) {
  1986. calendar.fullCalendar('renderEvent', {
  1987. title: title,
  1988. start: started,
  1989. end: end,
  1990. allDay: allDay
  1991. },
  1992. true // make the event "stick"
  1993. );
  1994. }
  1995. $('#title').val('');
  1996. calendar.fullCalendar('unselect');
  1997. $('.antoclose').click();
  1998. return false;
  1999. });
  2000. },
  2001. eventClick: function(calEvent, jsEvent, view) {
  2002. $('#fc_edit').click();
  2003. $('#title2').val(calEvent.title);
  2004. categoryClass = $("#event_type").val();
  2005. $(".antosubmit2").on("click", function() {
  2006. calEvent.title = $("#title2").val();
  2007. calendar.fullCalendar('updateEvent', calEvent);
  2008. $('.antoclose2').click();
  2009. });
  2010. calendar.fullCalendar('unselect');
  2011. },
  2012. editable: true,
  2013. events: [{
  2014. title: 'All Day Event',
  2015. start: new Date(y, m, 1)
  2016. }, {
  2017. title: 'Long Event',
  2018. start: new Date(y, m, d - 5),
  2019. end: new Date(y, m, d - 2)
  2020. }, {
  2021. title: 'Meeting',
  2022. start: new Date(y, m, d, 10, 30),
  2023. allDay: false
  2024. }, {
  2025. title: 'Lunch',
  2026. start: new Date(y, m, d + 14, 12, 0),
  2027. end: new Date(y, m, d, 14, 0),
  2028. allDay: false
  2029. }, {
  2030. title: 'Birthday Party',
  2031. start: new Date(y, m, d + 1, 19, 0),
  2032. end: new Date(y, m, d + 1, 22, 30),
  2033. allDay: false
  2034. }, {
  2035. title: 'Click for Google',
  2036. start: new Date(y, m, 28),
  2037. end: new Date(y, m, 29),
  2038. url: 'http://google.com/'
  2039. }]
  2040. });
  2041. };
  2042. /* DATA TABLES */
  2043. function init_DataTables() {
  2044. console.log('run_datatables');
  2045. if( typeof ($.fn.DataTable) === 'undefined'){ return; }
  2046. console.log('init_DataTables');
  2047. var handleDataTableButtons = function() {
  2048. if ($("#datatable-buttons").length) {
  2049. $("#datatable-buttons").DataTable({
  2050. dom: "Bfrtip",
  2051. buttons: [
  2052. {
  2053. extend: "copy",
  2054. className: "btn-sm"
  2055. },
  2056. {
  2057. extend: "csv",
  2058. className: "btn-sm"
  2059. },
  2060. {
  2061. extend: "excel",
  2062. className: "btn-sm"
  2063. },
  2064. {
  2065. extend: "pdfHtml5",
  2066. className: "btn-sm"
  2067. },
  2068. {
  2069. extend: "print",
  2070. className: "btn-sm"
  2071. },
  2072. ],
  2073. responsive: true
  2074. });
  2075. }
  2076. };
  2077. TableManageButtons = function() {
  2078. "use strict";
  2079. return {
  2080. init: function() {
  2081. handleDataTableButtons();
  2082. }
  2083. };
  2084. }();
  2085. $('#datatable').dataTable();
  2086. $('#datatable-keytable').DataTable({
  2087. keys: true
  2088. });
  2089. $('#datatable-responsive').DataTable();
  2090. $('#datatable-scroller').DataTable({
  2091. ajax: "js/datatables/json/scroller-demo.json",
  2092. deferRender: true,
  2093. scrollY: 380,
  2094. scrollCollapse: true,
  2095. scroller: true
  2096. });
  2097. $('#datatable-fixed-header').DataTable({
  2098. fixedHeader: true
  2099. });
  2100. var $datatable = $('#datatable-checkbox');
  2101. $datatable.dataTable({
  2102. 'order': [[ 1, 'asc' ]],
  2103. 'columnDefs': [
  2104. { orderable: false, targets: [0] }
  2105. ]
  2106. });
  2107. $datatable.on('draw.dt', function() {
  2108. $('checkbox input').iCheck({
  2109. checkboxClass: 'icheckbox_flat-green'
  2110. });
  2111. });
  2112. TableManageButtons.init();
  2113. };
  2114. /* CHART - MORRIS */
  2115. function init_morris_charts() {
  2116. if( typeof (Morris) === 'undefined'){ return; }
  2117. console.log('init_morris_charts');
  2118. if ($('#graph_bar').length){
  2119. Morris.Bar({
  2120. element: 'graph_bar',
  2121. data: [
  2122. {device: 'iPhone 4', geekbench: 380},
  2123. {device: 'iPhone 4S', geekbench: 655},
  2124. {device: 'iPhone 3GS', geekbench: 275},
  2125. {device: 'iPhone 5', geekbench: 1571},
  2126. {device: 'iPhone 5S', geekbench: 655},
  2127. {device: 'iPhone 6', geekbench: 2154},
  2128. {device: 'iPhone 6 Plus', geekbench: 1144},
  2129. {device: 'iPhone 6S', geekbench: 2371},
  2130. {device: 'iPhone 6S Plus', geekbench: 1471},
  2131. {device: 'Other', geekbench: 1371}
  2132. ],
  2133. xkey: 'device',
  2134. ykeys: ['geekbench'],
  2135. labels: ['Geekbench'],
  2136. barRatio: 0.4,
  2137. barColors: ['#26B99A', '#34495E', '#ACADAC', '#3498DB'],
  2138. xLabelAngle: 35,
  2139. hideHover: 'auto',
  2140. resize: true
  2141. });
  2142. }
  2143. if ($('#graph_bar_group').length ){
  2144. Morris.Bar({
  2145. element: 'graph_bar_group',
  2146. data: [
  2147. {"period": "2016-10-01", "licensed": 807, "sorned": 660},
  2148. {"period": "2016-09-30", "licensed": 1251, "sorned": 729},
  2149. {"period": "2016-09-29", "licensed": 1769, "sorned": 1018},
  2150. {"period": "2016-09-20", "licensed": 2246, "sorned": 1461},
  2151. {"period": "2016-09-19", "licensed": 2657, "sorned": 1967},
  2152. {"period": "2016-09-18", "licensed": 3148, "sorned": 2627},
  2153. {"period": "2016-09-17", "licensed": 3471, "sorned": 3740},
  2154. {"period": "2016-09-16", "licensed": 2871, "sorned": 2216},
  2155. {"period": "2016-09-15", "licensed": 2401, "sorned": 1656},
  2156. {"period": "2016-09-10", "licensed": 2115, "sorned": 1022}
  2157. ],
  2158. xkey: 'period',
  2159. barColors: ['#26B99A', '#34495E', '#ACADAC', '#3498DB'],
  2160. ykeys: ['licensed', 'sorned'],
  2161. labels: ['Licensed', 'SORN'],
  2162. hideHover: 'auto',
  2163. xLabelAngle: 60,
  2164. resize: true
  2165. });
  2166. }
  2167. if ($('#graphx').length ){
  2168. Morris.Bar({
  2169. element: 'graphx',
  2170. data: [
  2171. {x: '2015 Q1', y: 2, z: 3, a: 4},
  2172. {x: '2015 Q2', y: 3, z: 5, a: 6},
  2173. {x: '2015 Q3', y: 4, z: 3, a: 2},
  2174. {x: '2015 Q4', y: 2, z: 4, a: 5}
  2175. ],
  2176. xkey: 'x',
  2177. ykeys: ['y', 'z', 'a'],
  2178. barColors: ['#26B99A', '#34495E', '#ACADAC', '#3498DB'],
  2179. hideHover: 'auto',
  2180. labels: ['Y', 'Z', 'A'],
  2181. resize: true
  2182. }).on('click', function (i, row) {
  2183. console.log(i, row);
  2184. });
  2185. }
  2186. if ($('#graph_area').length ){
  2187. Morris.Area({
  2188. element: 'graph_area',
  2189. data: [
  2190. {period: '2014 Q1', iphone: 2666, ipad: null, itouch: 2647},
  2191. {period: '2014 Q2', iphone: 2778, ipad: 2294, itouch: 2441},
  2192. {period: '2014 Q3', iphone: 4912, ipad: 1969, itouch: 2501},
  2193. {period: '2014 Q4', iphone: 3767, ipad: 3597, itouch: 5689},
  2194. {period: '2015 Q1', iphone: 6810, ipad: 1914, itouch: 2293},
  2195. {period: '2015 Q2', iphone: 5670, ipad: 4293, itouch: 1881},
  2196. {period: '2015 Q3', iphone: 4820, ipad: 3795, itouch: 1588},
  2197. {period: '2015 Q4', iphone: 15073, ipad: 5967, itouch: 5175},
  2198. {period: '2016 Q1', iphone: 10687, ipad: 4460, itouch: 2028},
  2199. {period: '2016 Q2', iphone: 8432, ipad: 5713, itouch: 1791}
  2200. ],
  2201. xkey: 'period',
  2202. ykeys: ['iphone', 'ipad', 'itouch'],
  2203. lineColors: ['#26B99A', '#34495E', '#ACADAC', '#3498DB'],
  2204. labels: ['iPhone', 'iPad', 'iPod Touch'],
  2205. pointSize: 2,
  2206. hideHover: 'auto',
  2207. resize: true
  2208. });
  2209. }
  2210. if ($('#graph_donut').length ){
  2211. Morris.Donut({
  2212. element: 'graph_donut',
  2213. data: [
  2214. {label: 'Jam', value: 25},
  2215. {label: 'Frosted', value: 40},
  2216. {label: 'Custard', value: 25},
  2217. {label: 'Sugar', value: 10}
  2218. ],
  2219. colors: ['#26B99A', '#34495E', '#ACADAC', '#3498DB'],
  2220. formatter: function (y) {
  2221. return y + "%";
  2222. },
  2223. resize: true
  2224. });
  2225. }
  2226. if ($('#graph_line').length ){
  2227. Morris.Line({
  2228. element: 'graph_line',
  2229. xkey: 'year',
  2230. ykeys: ['value'],
  2231. labels: ['Value'],
  2232. hideHover: 'auto',
  2233. lineColors: ['#26B99A', '#34495E', '#ACADAC', '#3498DB'],
  2234. data: [
  2235. {year: '2012', value: 20},
  2236. {year: '2013', value: 10},
  2237. {year: '2014', value: 5},
  2238. {year: '2015', value: 5},
  2239. {year: '2016', value: 20}
  2240. ],
  2241. resize: true
  2242. });
  2243. $MENU_TOGGLE.on('click', function() {
  2244. $(window).resize();
  2245. });
  2246. }
  2247. };
  2248. /* ECHRTS */
  2249. function init_echarts() {
  2250. if( typeof (echarts) === 'undefined'){ return; }
  2251. console.log('init_echarts');
  2252. var theme = {
  2253. color: [
  2254. '#26B99A', '#34495E', '#BDC3C7', '#3498DB',
  2255. '#9B59B6', '#8abb6f', '#759c6a', '#bfd3b7'
  2256. ],
  2257. title: {
  2258. itemGap: 8,
  2259. textStyle: {
  2260. fontWeight: 'normal',
  2261. color: '#408829'
  2262. }
  2263. },
  2264. dataRange: {
  2265. color: ['#1f610a', '#97b58d']
  2266. },
  2267. toolbox: {
  2268. color: ['#408829', '#408829', '#408829', '#408829']
  2269. },
  2270. tooltip: {
  2271. backgroundColor: 'rgba(0,0,0,0.5)',
  2272. axisPointer: {
  2273. type: 'line',
  2274. lineStyle: {
  2275. color: '#408829',
  2276. type: 'dashed'
  2277. },
  2278. crossStyle: {
  2279. color: '#408829'
  2280. },
  2281. shadowStyle: {
  2282. color: 'rgba(200,200,200,0.3)'
  2283. }
  2284. }
  2285. },
  2286. dataZoom: {
  2287. dataBackgroundColor: '#eee',
  2288. fillerColor: 'rgba(64,136,41,0.2)',
  2289. handleColor: '#408829'
  2290. },
  2291. grid: {
  2292. borderWidth: 0
  2293. },
  2294. categoryAxis: {
  2295. axisLine: {
  2296. lineStyle: {
  2297. color: '#408829'
  2298. }
  2299. },
  2300. splitLine: {
  2301. lineStyle: {
  2302. color: ['#eee']
  2303. }
  2304. }
  2305. },
  2306. valueAxis: {
  2307. axisLine: {
  2308. lineStyle: {
  2309. color: '#408829'
  2310. }
  2311. },
  2312. splitArea: {
  2313. show: true,
  2314. areaStyle: {
  2315. color: ['rgba(250,250,250,0.1)', 'rgba(200,200,200,0.1)']
  2316. }
  2317. },
  2318. splitLine: {
  2319. lineStyle: {
  2320. color: ['#eee']
  2321. }
  2322. }
  2323. },
  2324. timeline: {
  2325. lineStyle: {
  2326. color: '#408829'
  2327. },
  2328. controlStyle: {
  2329. normal: {color: '#408829'},
  2330. emphasis: {color: '#408829'}
  2331. }
  2332. },
  2333. k: {
  2334. itemStyle: {
  2335. normal: {
  2336. color: '#68a54a',
  2337. color0: '#a9cba2',
  2338. lineStyle: {
  2339. width: 1,
  2340. color: '#408829',
  2341. color0: '#86b379'
  2342. }
  2343. }
  2344. }
  2345. },
  2346. map: {
  2347. itemStyle: {
  2348. normal: {
  2349. areaStyle: {
  2350. color: '#ddd'
  2351. },
  2352. label: {
  2353. textStyle: {
  2354. color: '#c12e34'
  2355. }
  2356. }
  2357. },
  2358. emphasis: {
  2359. areaStyle: {
  2360. color: '#99d2dd'
  2361. },
  2362. label: {
  2363. textStyle: {
  2364. color: '#c12e34'
  2365. }
  2366. }
  2367. }
  2368. }
  2369. },
  2370. force: {
  2371. itemStyle: {
  2372. normal: {
  2373. linkStyle: {
  2374. strokeColor: '#408829'
  2375. }
  2376. }
  2377. }
  2378. },
  2379. chord: {
  2380. padding: 4,
  2381. itemStyle: {
  2382. normal: {
  2383. lineStyle: {
  2384. width: 1,
  2385. color: 'rgba(128, 128, 128, 0.5)'
  2386. },
  2387. chordStyle: {
  2388. lineStyle: {
  2389. width: 1,
  2390. color: 'rgba(128, 128, 128, 0.5)'
  2391. }
  2392. }
  2393. },
  2394. emphasis: {
  2395. lineStyle: {
  2396. width: 1,
  2397. color: 'rgba(128, 128, 128, 0.5)'
  2398. },
  2399. chordStyle: {
  2400. lineStyle: {
  2401. width: 1,
  2402. color: 'rgba(128, 128, 128, 0.5)'
  2403. }
  2404. }
  2405. }
  2406. }
  2407. },
  2408. gauge: {
  2409. startAngle: 225,
  2410. endAngle: -45,
  2411. axisLine: {
  2412. show: true,
  2413. lineStyle: {
  2414. color: [[0.2, '#86b379'], [0.8, '#68a54a'], [1, '#408829']],
  2415. width: 8
  2416. }
  2417. },
  2418. axisTick: {
  2419. splitNumber: 10,
  2420. length: 12,
  2421. lineStyle: {
  2422. color: 'auto'
  2423. }
  2424. },
  2425. axisLabel: {
  2426. textStyle: {
  2427. color: 'auto'
  2428. }
  2429. },
  2430. splitLine: {
  2431. length: 18,
  2432. lineStyle: {
  2433. color: 'auto'
  2434. }
  2435. },
  2436. pointer: {
  2437. length: '90%',
  2438. color: 'auto'
  2439. },
  2440. title: {
  2441. textStyle: {
  2442. color: '#333'
  2443. }
  2444. },
  2445. detail: {
  2446. textStyle: {
  2447. color: 'auto'
  2448. }
  2449. }
  2450. },
  2451. textStyle: {
  2452. fontFamily: 'Arial, Verdana, sans-serif'
  2453. }
  2454. };
  2455. //echart Bar
  2456. if ($('#mainb').length ){
  2457. var echartBar = echarts.init(document.getElementById('mainb'), theme);
  2458. echartBar.setOption({
  2459. title: {
  2460. text: 'Graph title',
  2461. subtext: 'Graph Sub-text'
  2462. },
  2463. tooltip: {
  2464. trigger: 'axis'
  2465. },
  2466. legend: {
  2467. data: ['sales', 'purchases']
  2468. },
  2469. toolbox: {
  2470. show: false
  2471. },
  2472. calculable: false,
  2473. xAxis: [{
  2474. type: 'category',
  2475. data: ['1?', '2?', '3?', '4?', '5?', '6?', '7?', '8?', '9?', '10?', '11?', '12?']
  2476. }],
  2477. yAxis: [{
  2478. type: 'value'
  2479. }],
  2480. series: [{
  2481. name: 'sales',
  2482. type: 'bar',
  2483. data: [2.0, 4.9, 7.0, 23.2, 25.6, 76.7, 135.6, 162.2, 32.6, 20.0, 6.4, 3.3],
  2484. markPoint: {
  2485. data: [{
  2486. type: 'max',
  2487. name: '???'
  2488. }, {
  2489. type: 'min',
  2490. name: '???'
  2491. }]
  2492. },
  2493. markLine: {
  2494. data: [{
  2495. type: 'average',
  2496. name: '???'
  2497. }]
  2498. }
  2499. }, {
  2500. name: 'purchases',
  2501. type: 'bar',
  2502. data: [2.6, 5.9, 9.0, 26.4, 28.7, 70.7, 175.6, 182.2, 48.7, 18.8, 6.0, 2.3],
  2503. markPoint: {
  2504. data: [{
  2505. name: 'sales',
  2506. value: 182.2,
  2507. xAxis: 7,
  2508. yAxis: 183,
  2509. }, {
  2510. name: 'purchases',
  2511. value: 2.3,
  2512. xAxis: 11,
  2513. yAxis: 3
  2514. }]
  2515. },
  2516. markLine: {
  2517. data: [{
  2518. type: 'average',
  2519. name: '???'
  2520. }]
  2521. }
  2522. }]
  2523. });
  2524. }
  2525. //echart Radar
  2526. if ($('#echart_sonar').length ){
  2527. var echartRadar = echarts.init(document.getElementById('echart_sonar'), theme);
  2528. echartRadar.setOption({
  2529. title: {
  2530. text: 'Budget vs spending',
  2531. subtext: 'Subtitle'
  2532. },
  2533. tooltip: {
  2534. trigger: 'item'
  2535. },
  2536. legend: {
  2537. orient: 'vertical',
  2538. x: 'right',
  2539. y: 'bottom',
  2540. data: ['Allocated Budget', 'Actual Spending']
  2541. },
  2542. toolbox: {
  2543. show: true,
  2544. feature: {
  2545. restore: {
  2546. show: true,
  2547. title: "Restore"
  2548. },
  2549. saveAsImage: {
  2550. show: true,
  2551. title: "Save Image"
  2552. }
  2553. }
  2554. },
  2555. polar: [{
  2556. indicator: [{
  2557. text: 'Sales',
  2558. max: 6000
  2559. }, {
  2560. text: 'Administration',
  2561. max: 16000
  2562. }, {
  2563. text: 'Information Techology',
  2564. max: 30000
  2565. }, {
  2566. text: 'Customer Support',
  2567. max: 38000
  2568. }, {
  2569. text: 'Development',
  2570. max: 52000
  2571. }, {
  2572. text: 'Marketing',
  2573. max: 25000
  2574. }]
  2575. }],
  2576. calculable: true,
  2577. series: [{
  2578. name: 'Budget vs spending',
  2579. type: 'radar',
  2580. data: [{
  2581. value: [4300, 10000, 28000, 35000, 50000, 19000],
  2582. name: 'Allocated Budget'
  2583. }, {
  2584. value: [5000, 14000, 28000, 31000, 42000, 21000],
  2585. name: 'Actual Spending'
  2586. }]
  2587. }]
  2588. });
  2589. }
  2590. //echart Funnel
  2591. if ($('#echart_pyramid').length ){
  2592. var echartFunnel = echarts.init(document.getElementById('echart_pyramid'), theme);
  2593. echartFunnel.setOption({
  2594. title: {
  2595. text: 'Echart Pyramid Graph',
  2596. subtext: 'Subtitle'
  2597. },
  2598. tooltip: {
  2599. trigger: 'item',
  2600. formatter: "{a} <br/>{b} : {c}%"
  2601. },
  2602. toolbox: {
  2603. show: true,
  2604. feature: {
  2605. restore: {
  2606. show: true,
  2607. title: "Restore"
  2608. },
  2609. saveAsImage: {
  2610. show: true,
  2611. title: "Save Image"
  2612. }
  2613. }
  2614. },
  2615. legend: {
  2616. data: ['Something #1', 'Something #2', 'Something #3', 'Something #4', 'Something #5'],
  2617. orient: 'vertical',
  2618. x: 'left',
  2619. y: 'bottom'
  2620. },
  2621. calculable: true,
  2622. series: [{
  2623. name: '漏斗图',
  2624. type: 'funnel',
  2625. width: '40%',
  2626. data: [{
  2627. value: 60,
  2628. name: 'Something #1'
  2629. }, {
  2630. value: 40,
  2631. name: 'Something #2'
  2632. }, {
  2633. value: 20,
  2634. name: 'Something #3'
  2635. }, {
  2636. value: 80,
  2637. name: 'Something #4'
  2638. }, {
  2639. value: 100,
  2640. name: 'Something #5'
  2641. }]
  2642. }]
  2643. });
  2644. }
  2645. //echart Gauge
  2646. if ($('#echart_gauge').length ){
  2647. var echartGauge = echarts.init(document.getElementById('echart_gauge'), theme);
  2648. echartGauge.setOption({
  2649. tooltip: {
  2650. formatter: "{a} <br/>{b} : {c}%"
  2651. },
  2652. toolbox: {
  2653. show: true,
  2654. feature: {
  2655. restore: {
  2656. show: true,
  2657. title: "Restore"
  2658. },
  2659. saveAsImage: {
  2660. show: true,
  2661. title: "Save Image"
  2662. }
  2663. }
  2664. },
  2665. series: [{
  2666. name: 'Performance',
  2667. type: 'gauge',
  2668. center: ['50%', '50%'],
  2669. startAngle: 140,
  2670. endAngle: -140,
  2671. min: 0,
  2672. max: 100,
  2673. precision: 0,
  2674. splitNumber: 10,
  2675. axisLine: {
  2676. show: true,
  2677. lineStyle: {
  2678. color: [
  2679. [0.2, 'lightgreen'],
  2680. [0.4, 'orange'],
  2681. [0.8, 'skyblue'],
  2682. [1, '#ff4500']
  2683. ],
  2684. width: 30
  2685. }
  2686. },
  2687. axisTick: {
  2688. show: true,
  2689. splitNumber: 5,
  2690. length: 8,
  2691. lineStyle: {
  2692. color: '#eee',
  2693. width: 1,
  2694. type: 'solid'
  2695. }
  2696. },
  2697. axisLabel: {
  2698. show: true,
  2699. formatter: function(v) {
  2700. switch (v + '') {
  2701. case '10':
  2702. return 'a';
  2703. case '30':
  2704. return 'b';
  2705. case '60':
  2706. return 'c';
  2707. case '90':
  2708. return 'd';
  2709. default:
  2710. return '';
  2711. }
  2712. },
  2713. textStyle: {
  2714. color: '#333'
  2715. }
  2716. },
  2717. splitLine: {
  2718. show: true,
  2719. length: 30,
  2720. lineStyle: {
  2721. color: '#eee',
  2722. width: 2,
  2723. type: 'solid'
  2724. }
  2725. },
  2726. pointer: {
  2727. length: '80%',
  2728. width: 8,
  2729. color: 'auto'
  2730. },
  2731. title: {
  2732. show: true,
  2733. offsetCenter: ['-65%', -10],
  2734. textStyle: {
  2735. color: '#333',
  2736. fontSize: 15
  2737. }
  2738. },
  2739. detail: {
  2740. show: true,
  2741. backgroundColor: 'rgba(0,0,0,0)',
  2742. borderWidth: 0,
  2743. borderColor: '#ccc',
  2744. width: 100,
  2745. height: 40,
  2746. offsetCenter: ['-60%', 10],
  2747. formatter: '{value}%',
  2748. textStyle: {
  2749. color: 'auto',
  2750. fontSize: 30
  2751. }
  2752. },
  2753. data: [{
  2754. value: 50,
  2755. name: 'Performance'
  2756. }]
  2757. }]
  2758. });
  2759. }
  2760. //echart Line
  2761. if ($('#echart_line').length ){
  2762. var echartLine = echarts.init(document.getElementById('echart_line'), theme);
  2763. echartLine.setOption({
  2764. title: {
  2765. text: 'Line Graph',
  2766. subtext: 'Subtitle'
  2767. },
  2768. tooltip: {
  2769. trigger: 'axis'
  2770. },
  2771. legend: {
  2772. x: 220,
  2773. y: 40,
  2774. data: ['Intent', 'Pre-order', 'Deal']
  2775. },
  2776. toolbox: {
  2777. show: true,
  2778. feature: {
  2779. magicType: {
  2780. show: true,
  2781. title: {
  2782. line: 'Line',
  2783. bar: 'Bar',
  2784. stack: 'Stack',
  2785. tiled: 'Tiled'
  2786. },
  2787. type: ['line', 'bar', 'stack', 'tiled']
  2788. },
  2789. restore: {
  2790. show: true,
  2791. title: "Restore"
  2792. },
  2793. saveAsImage: {
  2794. show: true,
  2795. title: "Save Image"
  2796. }
  2797. }
  2798. },
  2799. calculable: true,
  2800. xAxis: [{
  2801. type: 'category',
  2802. boundaryGap: false,
  2803. data: ['Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat', 'Sun']
  2804. }],
  2805. yAxis: [{
  2806. type: 'value'
  2807. }],
  2808. series: [{
  2809. name: 'Deal',
  2810. type: 'line',
  2811. smooth: true,
  2812. itemStyle: {
  2813. normal: {
  2814. areaStyle: {
  2815. type: 'default'
  2816. }
  2817. }
  2818. },
  2819. data: [10, 12, 21, 54, 260, 830, 710]
  2820. }, {
  2821. name: 'Pre-order',
  2822. type: 'line',
  2823. smooth: true,
  2824. itemStyle: {
  2825. normal: {
  2826. areaStyle: {
  2827. type: 'default'
  2828. }
  2829. }
  2830. },
  2831. data: [30, 182, 434, 791, 390, 30, 10]
  2832. }, {
  2833. name: 'Intent',
  2834. type: 'line',
  2835. smooth: true,
  2836. itemStyle: {
  2837. normal: {
  2838. areaStyle: {
  2839. type: 'default'
  2840. }
  2841. }
  2842. },
  2843. data: [1320, 1132, 601, 234, 120, 90, 20]
  2844. }]
  2845. });
  2846. }
  2847. //echart Scatter
  2848. if ($('#echart_scatter').length ){
  2849. var echartScatter = echarts.init(document.getElementById('echart_scatter'), theme);
  2850. echartScatter.setOption({
  2851. title: {
  2852. text: 'Scatter Graph',
  2853. subtext: 'Heinz 2003'
  2854. },
  2855. tooltip: {
  2856. trigger: 'axis',
  2857. showDelay: 0,
  2858. axisPointer: {
  2859. type: 'cross',
  2860. lineStyle: {
  2861. type: 'dashed',
  2862. width: 1
  2863. }
  2864. }
  2865. },
  2866. legend: {
  2867. data: ['Data2', 'Data1']
  2868. },
  2869. toolbox: {
  2870. show: true,
  2871. feature: {
  2872. saveAsImage: {
  2873. show: true,
  2874. title: "Save Image"
  2875. }
  2876. }
  2877. },
  2878. xAxis: [{
  2879. type: 'value',
  2880. scale: true,
  2881. axisLabel: {
  2882. formatter: '{value} cm'
  2883. }
  2884. }],
  2885. yAxis: [{
  2886. type: 'value',
  2887. scale: true,
  2888. axisLabel: {
  2889. formatter: '{value} kg'
  2890. }
  2891. }],
  2892. series: [{
  2893. name: 'Data1',
  2894. type: 'scatter',
  2895. tooltip: {
  2896. trigger: 'item',
  2897. formatter: function(params) {
  2898. if (params.value.length > 1) {
  2899. return params.seriesName + ' :<br/>' + params.value[0] + 'cm ' + params.value[1] + 'kg ';
  2900. } else {
  2901. return params.seriesName + ' :<br/>' + params.name + ' : ' + params.value + 'kg ';
  2902. }
  2903. }
  2904. },
  2905. data: [
  2906. [161.2, 51.6],
  2907. [167.5, 59.0],
  2908. [159.5, 49.2],
  2909. [157.0, 63.0],
  2910. [155.8, 53.6],
  2911. [170.0, 59.0],
  2912. [159.1, 47.6],
  2913. [166.0, 69.8],
  2914. [176.2, 66.8],
  2915. [160.2, 75.2],
  2916. [172.5, 55.2],
  2917. [170.9, 54.2],
  2918. [172.9, 62.5],
  2919. [153.4, 42.0],
  2920. [160.0, 50.0],
  2921. [147.2, 49.8],
  2922. [168.2, 49.2],
  2923. [175.0, 73.2],
  2924. [157.0, 47.8],
  2925. [167.6, 68.8],
  2926. [159.5, 50.6],
  2927. [175.0, 82.5],
  2928. [166.8, 57.2],
  2929. [176.5, 87.8],
  2930. [170.2, 72.8],
  2931. [174.0, 54.5],
  2932. [173.0, 59.8],
  2933. [179.9, 67.3],
  2934. [170.5, 67.8],
  2935. [160.0, 47.0],
  2936. [154.4, 46.2],
  2937. [162.0, 55.0],
  2938. [176.5, 83.0],
  2939. [160.0, 54.4],
  2940. [152.0, 45.8],
  2941. [162.1, 53.6],
  2942. [170.0, 73.2],
  2943. [160.2, 52.1],
  2944. [161.3, 67.9],
  2945. [166.4, 56.6],
  2946. [168.9, 62.3],
  2947. [163.8, 58.5],
  2948. [167.6, 54.5],
  2949. [160.0, 50.2],
  2950. [161.3, 60.3],
  2951. [167.6, 58.3],
  2952. [165.1, 56.2],
  2953. [160.0, 50.2],
  2954. [170.0, 72.9],
  2955. [157.5, 59.8],
  2956. [167.6, 61.0],
  2957. [160.7, 69.1],
  2958. [163.2, 55.9],
  2959. [152.4, 46.5],
  2960. [157.5, 54.3],
  2961. [168.3, 54.8],
  2962. [180.3, 60.7],
  2963. [165.5, 60.0],
  2964. [165.0, 62.0],
  2965. [164.5, 60.3],
  2966. [156.0, 52.7],
  2967. [160.0, 74.3],
  2968. [163.0, 62.0],
  2969. [165.7, 73.1],
  2970. [161.0, 80.0],
  2971. [162.0, 54.7],
  2972. [166.0, 53.2],
  2973. [174.0, 75.7],
  2974. [172.7, 61.1],
  2975. [167.6, 55.7],
  2976. [151.1, 48.7],
  2977. [164.5, 52.3],
  2978. [163.5, 50.0],
  2979. [152.0, 59.3],
  2980. [169.0, 62.5],
  2981. [164.0, 55.7],
  2982. [161.2, 54.8],
  2983. [155.0, 45.9],
  2984. [170.0, 70.6],
  2985. [176.2, 67.2],
  2986. [170.0, 69.4],
  2987. [162.5, 58.2],
  2988. [170.3, 64.8],
  2989. [164.1, 71.6],
  2990. [169.5, 52.8],
  2991. [163.2, 59.8],
  2992. [154.5, 49.0],
  2993. [159.8, 50.0],
  2994. [173.2, 69.2],
  2995. [170.0, 55.9],
  2996. [161.4, 63.4],
  2997. [169.0, 58.2],
  2998. [166.2, 58.6],
  2999. [159.4, 45.7],
  3000. [162.5, 52.2],
  3001. [159.0, 48.6],
  3002. [162.8, 57.8],
  3003. [159.0, 55.6],
  3004. [179.8, 66.8],
  3005. [162.9, 59.4],
  3006. [161.0, 53.6],
  3007. [151.1, 73.2],
  3008. [168.2, 53.4],
  3009. [168.9, 69.0],
  3010. [173.2, 58.4],
  3011. [171.8, 56.2],
  3012. [178.0, 70.6],
  3013. [164.3, 59.8],
  3014. [163.0, 72.0],
  3015. [168.5, 65.2],
  3016. [166.8, 56.6],
  3017. [172.7, 105.2],
  3018. [163.5, 51.8],
  3019. [169.4, 63.4],
  3020. [167.8, 59.0],
  3021. [159.5, 47.6],
  3022. [167.6, 63.0],
  3023. [161.2, 55.2],
  3024. [160.0, 45.0],
  3025. [163.2, 54.0],
  3026. [162.2, 50.2],
  3027. [161.3, 60.2],
  3028. [149.5, 44.8],
  3029. [157.5, 58.8],
  3030. [163.2, 56.4],
  3031. [172.7, 62.0],
  3032. [155.0, 49.2],
  3033. [156.5, 67.2],
  3034. [164.0, 53.8],
  3035. [160.9, 54.4],
  3036. [162.8, 58.0],
  3037. [167.0, 59.8],
  3038. [160.0, 54.8],
  3039. [160.0, 43.2],
  3040. [168.9, 60.5],
  3041. [158.2, 46.4],
  3042. [156.0, 64.4],
  3043. [160.0, 48.8],
  3044. [167.1, 62.2],
  3045. [158.0, 55.5],
  3046. [167.6, 57.8],
  3047. [156.0, 54.6],
  3048. [162.1, 59.2],
  3049. [173.4, 52.7],
  3050. [159.8, 53.2],
  3051. [170.5, 64.5],
  3052. [159.2, 51.8],
  3053. [157.5, 56.0],
  3054. [161.3, 63.6],
  3055. [162.6, 63.2],
  3056. [160.0, 59.5],
  3057. [168.9, 56.8],
  3058. [165.1, 64.1],
  3059. [162.6, 50.0],
  3060. [165.1, 72.3],
  3061. [166.4, 55.0],
  3062. [160.0, 55.9],
  3063. [152.4, 60.4],
  3064. [170.2, 69.1],
  3065. [162.6, 84.5],
  3066. [170.2, 55.9],
  3067. [158.8, 55.5],
  3068. [172.7, 69.5],
  3069. [167.6, 76.4],
  3070. [162.6, 61.4],
  3071. [167.6, 65.9],
  3072. [156.2, 58.6],
  3073. [175.2, 66.8],
  3074. [172.1, 56.6],
  3075. [162.6, 58.6],
  3076. [160.0, 55.9],
  3077. [165.1, 59.1],
  3078. [182.9, 81.8],
  3079. [166.4, 70.7],
  3080. [165.1, 56.8],
  3081. [177.8, 60.0],
  3082. [165.1, 58.2],
  3083. [175.3, 72.7],
  3084. [154.9, 54.1],
  3085. [158.8, 49.1],
  3086. [172.7, 75.9],
  3087. [168.9, 55.0],
  3088. [161.3, 57.3],
  3089. [167.6, 55.0],
  3090. [165.1, 65.5],
  3091. [175.3, 65.5],
  3092. [157.5, 48.6],
  3093. [163.8, 58.6],
  3094. [167.6, 63.6],
  3095. [165.1, 55.2],
  3096. [165.1, 62.7],
  3097. [168.9, 56.6],
  3098. [162.6, 53.9],
  3099. [164.5, 63.2],
  3100. [176.5, 73.6],
  3101. [168.9, 62.0],
  3102. [175.3, 63.6],
  3103. [159.4, 53.2],
  3104. [160.0, 53.4],
  3105. [170.2, 55.0],
  3106. [162.6, 70.5],
  3107. [167.6, 54.5],
  3108. [162.6, 54.5],
  3109. [160.7, 55.9],
  3110. [160.0, 59.0],
  3111. [157.5, 63.6],
  3112. [162.6, 54.5],
  3113. [152.4, 47.3],
  3114. [170.2, 67.7],
  3115. [165.1, 80.9],
  3116. [172.7, 70.5],
  3117. [165.1, 60.9],
  3118. [170.2, 63.6],
  3119. [170.2, 54.5],
  3120. [170.2, 59.1],
  3121. [161.3, 70.5],
  3122. [167.6, 52.7],
  3123. [167.6, 62.7],
  3124. [165.1, 86.3],
  3125. [162.6, 66.4],
  3126. [152.4, 67.3],
  3127. [168.9, 63.0],
  3128. [170.2, 73.6],
  3129. [175.2, 62.3],
  3130. [175.2, 57.7],
  3131. [160.0, 55.4],
  3132. [165.1, 104.1],
  3133. [174.0, 55.5],
  3134. [170.2, 77.3],
  3135. [160.0, 80.5],
  3136. [167.6, 64.5],
  3137. [167.6, 72.3],
  3138. [167.6, 61.4],
  3139. [154.9, 58.2],
  3140. [162.6, 81.8],
  3141. [175.3, 63.6],
  3142. [171.4, 53.4],
  3143. [157.5, 54.5],
  3144. [165.1, 53.6],
  3145. [160.0, 60.0],
  3146. [174.0, 73.6],
  3147. [162.6, 61.4],
  3148. [174.0, 55.5],
  3149. [162.6, 63.6],
  3150. [161.3, 60.9],
  3151. [156.2, 60.0],
  3152. [149.9, 46.8],
  3153. [169.5, 57.3],
  3154. [160.0, 64.1],
  3155. [175.3, 63.6],
  3156. [169.5, 67.3],
  3157. [160.0, 75.5],
  3158. [172.7, 68.2],
  3159. [162.6, 61.4],
  3160. [157.5, 76.8],
  3161. [176.5, 71.8],
  3162. [164.4, 55.5],
  3163. [160.7, 48.6],
  3164. [174.0, 66.4],
  3165. [163.8, 67.3]
  3166. ],
  3167. markPoint: {
  3168. data: [{
  3169. type: 'max',
  3170. name: 'Max'
  3171. }, {
  3172. type: 'min',
  3173. name: 'Min'
  3174. }]
  3175. },
  3176. markLine: {
  3177. data: [{
  3178. type: 'average',
  3179. name: 'Mean'
  3180. }]
  3181. }
  3182. }, {
  3183. name: 'Data2',
  3184. type: 'scatter',
  3185. tooltip: {
  3186. trigger: 'item',
  3187. formatter: function(params) {
  3188. if (params.value.length > 1) {
  3189. return params.seriesName + ' :<br/>' + params.value[0] + 'cm ' + params.value[1] + 'kg ';
  3190. } else {
  3191. return params.seriesName + ' :<br/>' + params.name + ' : ' + params.value + 'kg ';
  3192. }
  3193. }
  3194. },
  3195. data: [
  3196. [174.0, 65.6],
  3197. [175.3, 71.8],
  3198. [193.5, 80.7],
  3199. [186.5, 72.6],
  3200. [187.2, 78.8],
  3201. [181.5, 74.8],
  3202. [184.0, 86.4],
  3203. [184.5, 78.4],
  3204. [175.0, 62.0],
  3205. [184.0, 81.6],
  3206. [180.0, 76.6],
  3207. [177.8, 83.6],
  3208. [192.0, 90.0],
  3209. [176.0, 74.6],
  3210. [174.0, 71.0],
  3211. [184.0, 79.6],
  3212. [192.7, 93.8],
  3213. [171.5, 70.0],
  3214. [173.0, 72.4],
  3215. [176.0, 85.9],
  3216. [176.0, 78.8],
  3217. [180.5, 77.8],
  3218. [172.7, 66.2],
  3219. [176.0, 86.4],
  3220. [173.5, 81.8],
  3221. [178.0, 89.6],
  3222. [180.3, 82.8],
  3223. [180.3, 76.4],
  3224. [164.5, 63.2],
  3225. [173.0, 60.9],
  3226. [183.5, 74.8],
  3227. [175.5, 70.0],
  3228. [188.0, 72.4],
  3229. [189.2, 84.1],
  3230. [172.8, 69.1],
  3231. [170.0, 59.5],
  3232. [182.0, 67.2],
  3233. [170.0, 61.3],
  3234. [177.8, 68.6],
  3235. [184.2, 80.1],
  3236. [186.7, 87.8],
  3237. [171.4, 84.7],
  3238. [172.7, 73.4],
  3239. [175.3, 72.1],
  3240. [180.3, 82.6],
  3241. [182.9, 88.7],
  3242. [188.0, 84.1],
  3243. [177.2, 94.1],
  3244. [172.1, 74.9],
  3245. [167.0, 59.1],
  3246. [169.5, 75.6],
  3247. [174.0, 86.2],
  3248. [172.7, 75.3],
  3249. [182.2, 87.1],
  3250. [164.1, 55.2],
  3251. [163.0, 57.0],
  3252. [171.5, 61.4],
  3253. [184.2, 76.8],
  3254. [174.0, 86.8],
  3255. [174.0, 72.2],
  3256. [177.0, 71.6],
  3257. [186.0, 84.8],
  3258. [167.0, 68.2],
  3259. [171.8, 66.1],
  3260. [182.0, 72.0],
  3261. [167.0, 64.6],
  3262. [177.8, 74.8],
  3263. [164.5, 70.0],
  3264. [192.0, 101.6],
  3265. [175.5, 63.2],
  3266. [171.2, 79.1],
  3267. [181.6, 78.9],
  3268. [167.4, 67.7],
  3269. [181.1, 66.0],
  3270. [177.0, 68.2],
  3271. [174.5, 63.9],
  3272. [177.5, 72.0],
  3273. [170.5, 56.8],
  3274. [182.4, 74.5],
  3275. [197.1, 90.9],
  3276. [180.1, 93.0],
  3277. [175.5, 80.9],
  3278. [180.6, 72.7],
  3279. [184.4, 68.0],
  3280. [175.5, 70.9],
  3281. [180.6, 72.5],
  3282. [177.0, 72.5],
  3283. [177.1, 83.4],
  3284. [181.6, 75.5],
  3285. [176.5, 73.0],
  3286. [175.0, 70.2],
  3287. [174.0, 73.4],
  3288. [165.1, 70.5],
  3289. [177.0, 68.9],
  3290. [192.0, 102.3],
  3291. [176.5, 68.4],
  3292. [169.4, 65.9],
  3293. [182.1, 75.7],
  3294. [179.8, 84.5],
  3295. [175.3, 87.7],
  3296. [184.9, 86.4],
  3297. [177.3, 73.2],
  3298. [167.4, 53.9],
  3299. [178.1, 72.0],
  3300. [168.9, 55.5],
  3301. [157.2, 58.4],
  3302. [180.3, 83.2],
  3303. [170.2, 72.7],
  3304. [177.8, 64.1],
  3305. [172.7, 72.3],
  3306. [165.1, 65.0],
  3307. [186.7, 86.4],
  3308. [165.1, 65.0],
  3309. [174.0, 88.6],
  3310. [175.3, 84.1],
  3311. [185.4, 66.8],
  3312. [177.8, 75.5],
  3313. [180.3, 93.2],
  3314. [180.3, 82.7],
  3315. [177.8, 58.0],
  3316. [177.8, 79.5],
  3317. [177.8, 78.6],
  3318. [177.8, 71.8],
  3319. [177.8, 116.4],
  3320. [163.8, 72.2],
  3321. [188.0, 83.6],
  3322. [198.1, 85.5],
  3323. [175.3, 90.9],
  3324. [166.4, 85.9],
  3325. [190.5, 89.1],
  3326. [166.4, 75.0],
  3327. [177.8, 77.7],
  3328. [179.7, 86.4],
  3329. [172.7, 90.9],
  3330. [190.5, 73.6],
  3331. [185.4, 76.4],
  3332. [168.9, 69.1],
  3333. [167.6, 84.5],
  3334. [175.3, 64.5],
  3335. [170.2, 69.1],
  3336. [190.5, 108.6],
  3337. [177.8, 86.4],
  3338. [190.5, 80.9],
  3339. [177.8, 87.7],
  3340. [184.2, 94.5],
  3341. [176.5, 80.2],
  3342. [177.8, 72.0],
  3343. [180.3, 71.4],
  3344. [171.4, 72.7],
  3345. [172.7, 84.1],
  3346. [172.7, 76.8],
  3347. [177.8, 63.6],
  3348. [177.8, 80.9],
  3349. [182.9, 80.9],
  3350. [170.2, 85.5],
  3351. [167.6, 68.6],
  3352. [175.3, 67.7],
  3353. [165.1, 66.4],
  3354. [185.4, 102.3],
  3355. [181.6, 70.5],
  3356. [172.7, 95.9],
  3357. [190.5, 84.1],
  3358. [179.1, 87.3],
  3359. [175.3, 71.8],
  3360. [170.2, 65.9],
  3361. [193.0, 95.9],
  3362. [171.4, 91.4],
  3363. [177.8, 81.8],
  3364. [177.8, 96.8],
  3365. [167.6, 69.1],
  3366. [167.6, 82.7],
  3367. [180.3, 75.5],
  3368. [182.9, 79.5],
  3369. [176.5, 73.6],
  3370. [186.7, 91.8],
  3371. [188.0, 84.1],
  3372. [188.0, 85.9],
  3373. [177.8, 81.8],
  3374. [174.0, 82.5],
  3375. [177.8, 80.5],
  3376. [171.4, 70.0],
  3377. [185.4, 81.8],
  3378. [185.4, 84.1],
  3379. [188.0, 90.5],
  3380. [188.0, 91.4],
  3381. [182.9, 89.1],
  3382. [176.5, 85.0],
  3383. [175.3, 69.1],
  3384. [175.3, 73.6],
  3385. [188.0, 80.5],
  3386. [188.0, 82.7],
  3387. [175.3, 86.4],
  3388. [170.5, 67.7],
  3389. [179.1, 92.7],
  3390. [177.8, 93.6],
  3391. [175.3, 70.9],
  3392. [182.9, 75.0],
  3393. [170.8, 93.2],
  3394. [188.0, 93.2],
  3395. [180.3, 77.7],
  3396. [177.8, 61.4],
  3397. [185.4, 94.1],
  3398. [168.9, 75.0],
  3399. [185.4, 83.6],
  3400. [180.3, 85.5],
  3401. [174.0, 73.9],
  3402. [167.6, 66.8],
  3403. [182.9, 87.3],
  3404. [160.0, 72.3],
  3405. [180.3, 88.6],
  3406. [167.6, 75.5],
  3407. [186.7, 101.4],
  3408. [175.3, 91.1],
  3409. [175.3, 67.3],
  3410. [175.9, 77.7],
  3411. [175.3, 81.8],
  3412. [179.1, 75.5],
  3413. [181.6, 84.5],
  3414. [177.8, 76.6],
  3415. [182.9, 85.0],
  3416. [177.8, 102.5],
  3417. [184.2, 77.3],
  3418. [179.1, 71.8],
  3419. [176.5, 87.9],
  3420. [188.0, 94.3],
  3421. [174.0, 70.9],
  3422. [167.6, 64.5],
  3423. [170.2, 77.3],
  3424. [167.6, 72.3],
  3425. [188.0, 87.3],
  3426. [174.0, 80.0],
  3427. [176.5, 82.3],
  3428. [180.3, 73.6],
  3429. [167.6, 74.1],
  3430. [188.0, 85.9],
  3431. [180.3, 73.2],
  3432. [167.6, 76.3],
  3433. [183.0, 65.9],
  3434. [183.0, 90.9],
  3435. [179.1, 89.1],
  3436. [170.2, 62.3],
  3437. [177.8, 82.7],
  3438. [179.1, 79.1],
  3439. [190.5, 98.2],
  3440. [177.8, 84.1],
  3441. [180.3, 83.2],
  3442. [180.3, 83.2]
  3443. ],
  3444. markPoint: {
  3445. data: [{
  3446. type: 'max',
  3447. name: 'Max'
  3448. }, {
  3449. type: 'min',
  3450. name: 'Min'
  3451. }]
  3452. },
  3453. markLine: {
  3454. data: [{
  3455. type: 'average',
  3456. name: 'Mean'
  3457. }]
  3458. }
  3459. }]
  3460. });
  3461. }
  3462. //echart Bar Horizontal
  3463. if ($('#echart_bar_horizontal').length ){
  3464. var echartBar = echarts.init(document.getElementById('echart_bar_horizontal'), theme);
  3465. echartBar.setOption({
  3466. title: {
  3467. text: 'Bar Graph',
  3468. subtext: 'Graph subtitle'
  3469. },
  3470. tooltip: {
  3471. trigger: 'axis'
  3472. },
  3473. legend: {
  3474. x: 100,
  3475. data: ['2015', '2016']
  3476. },
  3477. toolbox: {
  3478. show: true,
  3479. feature: {
  3480. saveAsImage: {
  3481. show: true,
  3482. title: "Save Image"
  3483. }
  3484. }
  3485. },
  3486. calculable: true,
  3487. xAxis: [{
  3488. type: 'value',
  3489. boundaryGap: [0, 0.01]
  3490. }],
  3491. yAxis: [{
  3492. type: 'category',
  3493. data: ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun']
  3494. }],
  3495. series: [{
  3496. name: '2015',
  3497. type: 'bar',
  3498. data: [18203, 23489, 29034, 104970, 131744, 630230]
  3499. }, {
  3500. name: '2016',
  3501. type: 'bar',
  3502. data: [19325, 23438, 31000, 121594, 134141, 681807]
  3503. }]
  3504. });
  3505. }
  3506. //echart Pie Collapse
  3507. if ($('#echart_pie2').length ){
  3508. var echartPieCollapse = echarts.init(document.getElementById('echart_pie2'), theme);
  3509. echartPieCollapse.setOption({
  3510. tooltip: {
  3511. trigger: 'item',
  3512. formatter: "{a} <br/>{b} : {c} ({d}%)"
  3513. },
  3514. legend: {
  3515. x: 'center',
  3516. y: 'bottom',
  3517. data: ['rose1', 'rose2', 'rose3', 'rose4', 'rose5', 'rose6']
  3518. },
  3519. toolbox: {
  3520. show: true,
  3521. feature: {
  3522. magicType: {
  3523. show: true,
  3524. type: ['pie', 'funnel']
  3525. },
  3526. restore: {
  3527. show: true,
  3528. title: "Restore"
  3529. },
  3530. saveAsImage: {
  3531. show: true,
  3532. title: "Save Image"
  3533. }
  3534. }
  3535. },
  3536. calculable: true,
  3537. series: [{
  3538. name: 'Area Mode',
  3539. type: 'pie',
  3540. radius: [25, 90],
  3541. center: ['50%', 170],
  3542. roseType: 'area',
  3543. x: '50%',
  3544. max: 40,
  3545. sort: 'ascending',
  3546. data: [{
  3547. value: 10,
  3548. name: 'rose1'
  3549. }, {
  3550. value: 5,
  3551. name: 'rose2'
  3552. }, {
  3553. value: 15,
  3554. name: 'rose3'
  3555. }, {
  3556. value: 25,
  3557. name: 'rose4'
  3558. }, {
  3559. value: 20,
  3560. name: 'rose5'
  3561. }, {
  3562. value: 35,
  3563. name: 'rose6'
  3564. }]
  3565. }]
  3566. });
  3567. }
  3568. //echart Donut
  3569. if ($('#echart_donut').length ){
  3570. var echartDonut = echarts.init(document.getElementById('echart_donut'), theme);
  3571. echartDonut.setOption({
  3572. tooltip: {
  3573. trigger: 'item',
  3574. formatter: "{a} <br/>{b} : {c} ({d}%)"
  3575. },
  3576. calculable: true,
  3577. legend: {
  3578. x: 'center',
  3579. y: 'bottom',
  3580. data: ['Direct Access', 'E-mail Marketing', 'Union Ad', 'Video Ads', 'Search Engine']
  3581. },
  3582. toolbox: {
  3583. show: true,
  3584. feature: {
  3585. magicType: {
  3586. show: true,
  3587. type: ['pie', 'funnel'],
  3588. option: {
  3589. funnel: {
  3590. x: '25%',
  3591. width: '50%',
  3592. funnelAlign: 'center',
  3593. max: 1548
  3594. }
  3595. }
  3596. },
  3597. restore: {
  3598. show: true,
  3599. title: "Restore"
  3600. },
  3601. saveAsImage: {
  3602. show: true,
  3603. title: "Save Image"
  3604. }
  3605. }
  3606. },
  3607. series: [{
  3608. name: 'Access to the resource',
  3609. type: 'pie',
  3610. radius: ['35%', '55%'],
  3611. itemStyle: {
  3612. normal: {
  3613. label: {
  3614. show: true
  3615. },
  3616. labelLine: {
  3617. show: true
  3618. }
  3619. },
  3620. emphasis: {
  3621. label: {
  3622. show: true,
  3623. position: 'center',
  3624. textStyle: {
  3625. fontSize: '14',
  3626. fontWeight: 'normal'
  3627. }
  3628. }
  3629. }
  3630. },
  3631. data: [{
  3632. value: 335,
  3633. name: 'Direct Access'
  3634. }, {
  3635. value: 310,
  3636. name: 'E-mail Marketing'
  3637. }, {
  3638. value: 234,
  3639. name: 'Union Ad'
  3640. }, {
  3641. value: 135,
  3642. name: 'Video Ads'
  3643. }, {
  3644. value: 1548,
  3645. name: 'Search Engine'
  3646. }]
  3647. }]
  3648. });
  3649. }
  3650. //echart Pie
  3651. if ($('#echart_pie').length ){
  3652. var echartPie = echarts.init(document.getElementById('echart_pie'), theme);
  3653. echartPie.setOption({
  3654. tooltip: {
  3655. trigger: 'item',
  3656. formatter: "{a} <br/>{b} : {c} ({d}%)"
  3657. },
  3658. legend: {
  3659. x: 'center',
  3660. y: 'bottom',
  3661. data: ['Direct Access', 'E-mail Marketing', 'Union Ad', 'Video Ads', 'Search Engine']
  3662. },
  3663. toolbox: {
  3664. show: true,
  3665. feature: {
  3666. magicType: {
  3667. show: true,
  3668. type: ['pie', 'funnel'],
  3669. option: {
  3670. funnel: {
  3671. x: '25%',
  3672. width: '50%',
  3673. funnelAlign: 'left',
  3674. max: 1548
  3675. }
  3676. }
  3677. },
  3678. restore: {
  3679. show: true,
  3680. title: "Restore"
  3681. },
  3682. saveAsImage: {
  3683. show: true,
  3684. title: "Save Image"
  3685. }
  3686. }
  3687. },
  3688. calculable: true,
  3689. series: [{
  3690. name: '访问来源',
  3691. type: 'pie',
  3692. radius: '55%',
  3693. center: ['50%', '48%'],
  3694. data: [{
  3695. value: 335,
  3696. name: 'Direct Access'
  3697. }, {
  3698. value: 310,
  3699. name: 'E-mail Marketing'
  3700. }, {
  3701. value: 234,
  3702. name: 'Union Ad'
  3703. }, {
  3704. value: 135,
  3705. name: 'Video Ads'
  3706. }, {
  3707. value: 1548,
  3708. name: 'Search Engine'
  3709. }]
  3710. }]
  3711. });
  3712. var dataStyle = {
  3713. normal: {
  3714. label: {
  3715. show: false
  3716. },
  3717. labelLine: {
  3718. show: false
  3719. }
  3720. }
  3721. };
  3722. var placeHolderStyle = {
  3723. normal: {
  3724. color: 'rgba(0,0,0,0)',
  3725. label: {
  3726. show: false
  3727. },
  3728. labelLine: {
  3729. show: false
  3730. }
  3731. },
  3732. emphasis: {
  3733. color: 'rgba(0,0,0,0)'
  3734. }
  3735. };
  3736. }
  3737. //echart Mini Pie
  3738. if ($('#echart_mini_pie').length ){
  3739. var echartMiniPie = echarts.init(document.getElementById('echart_mini_pie'), theme);
  3740. echartMiniPie .setOption({
  3741. title: {
  3742. text: 'Chart #2',
  3743. subtext: 'From ExcelHome',
  3744. sublink: 'http://e.weibo.com/1341556070/AhQXtjbqh',
  3745. x: 'center',
  3746. y: 'center',
  3747. itemGap: 20,
  3748. textStyle: {
  3749. color: 'rgba(30,144,255,0.8)',
  3750. fontFamily: '微软雅黑',
  3751. fontSize: 35,
  3752. fontWeight: 'bolder'
  3753. }
  3754. },
  3755. tooltip: {
  3756. show: true,
  3757. formatter: "{a} <br/>{b} : {c} ({d}%)"
  3758. },
  3759. legend: {
  3760. orient: 'vertical',
  3761. x: 170,
  3762. y: 45,
  3763. itemGap: 12,
  3764. data: ['68%Something #1', '29%Something #2', '3%Something #3'],
  3765. },
  3766. toolbox: {
  3767. show: true,
  3768. feature: {
  3769. mark: {
  3770. show: true
  3771. },
  3772. dataView: {
  3773. show: true,
  3774. title: "Text View",
  3775. lang: [
  3776. "Text View",
  3777. "Close",
  3778. "Refresh",
  3779. ],
  3780. readOnly: false
  3781. },
  3782. restore: {
  3783. show: true,
  3784. title: "Restore"
  3785. },
  3786. saveAsImage: {
  3787. show: true,
  3788. title: "Save Image"
  3789. }
  3790. }
  3791. },
  3792. series: [{
  3793. name: '1',
  3794. type: 'pie',
  3795. clockWise: false,
  3796. radius: [105, 130],
  3797. itemStyle: dataStyle,
  3798. data: [{
  3799. value: 68,
  3800. name: '68%Something #1'
  3801. }, {
  3802. value: 32,
  3803. name: 'invisible',
  3804. itemStyle: placeHolderStyle
  3805. }]
  3806. }, {
  3807. name: '2',
  3808. type: 'pie',
  3809. clockWise: false,
  3810. radius: [80, 105],
  3811. itemStyle: dataStyle,
  3812. data: [{
  3813. value: 29,
  3814. name: '29%Something #2'
  3815. }, {
  3816. value: 71,
  3817. name: 'invisible',
  3818. itemStyle: placeHolderStyle
  3819. }]
  3820. }, {
  3821. name: '3',
  3822. type: 'pie',
  3823. clockWise: false,
  3824. radius: [25, 80],
  3825. itemStyle: dataStyle,
  3826. data: [{
  3827. value: 3,
  3828. name: '3%Something #3'
  3829. }, {
  3830. value: 97,
  3831. name: 'invisible',
  3832. itemStyle: placeHolderStyle
  3833. }]
  3834. }]
  3835. });
  3836. }
  3837. //echart Map
  3838. if ($('#echart_world_map').length ){
  3839. var echartMap = echarts.init(document.getElementById('echart_world_map'), theme);
  3840. echartMap.setOption({
  3841. title: {
  3842. text: 'World Population (2010)',
  3843. subtext: 'from United Nations, Total population, both sexes combined, as of 1 July (thousands)',
  3844. x: 'center',
  3845. y: 'top'
  3846. },
  3847. tooltip: {
  3848. trigger: 'item',
  3849. formatter: function(params) {
  3850. var value = (params.value + '').split('.');
  3851. value = value[0].replace(/(\d{1,3})(?=(?:\d{3})+(?!\d))/g, '$1,') + '.' + value[1];
  3852. return params.seriesName + '<br/>' + params.name + ' : ' + value;
  3853. }
  3854. },
  3855. toolbox: {
  3856. show: true,
  3857. orient: 'vertical',
  3858. x: 'right',
  3859. y: 'center',
  3860. feature: {
  3861. mark: {
  3862. show: true
  3863. },
  3864. dataView: {
  3865. show: true,
  3866. title: "Text View",
  3867. lang: [
  3868. "Text View",
  3869. "Close",
  3870. "Refresh",
  3871. ],
  3872. readOnly: false
  3873. },
  3874. restore: {
  3875. show: true,
  3876. title: "Restore"
  3877. },
  3878. saveAsImage: {
  3879. show: true,
  3880. title: "Save Image"
  3881. }
  3882. }
  3883. },
  3884. dataRange: {
  3885. min: 0,
  3886. max: 1000000,
  3887. text: ['High', 'Low'],
  3888. realtime: false,
  3889. calculable: true,
  3890. color: ['#087E65', '#26B99A', '#CBEAE3']
  3891. },
  3892. series: [{
  3893. name: 'World Population (2010)',
  3894. type: 'map',
  3895. mapType: 'world',
  3896. roam: false,
  3897. mapLocation: {
  3898. y: 60
  3899. },
  3900. itemStyle: {
  3901. emphasis: {
  3902. label: {
  3903. show: true
  3904. }
  3905. }
  3906. },
  3907. data: [{
  3908. name: 'Afghanistan',
  3909. value: 28397.812
  3910. }, {
  3911. name: 'Angola',
  3912. value: 19549.124
  3913. }, {
  3914. name: 'Albania',
  3915. value: 3150.143
  3916. }, {
  3917. name: 'United Arab Emirates',
  3918. value: 8441.537
  3919. }, {
  3920. name: 'Argentina',
  3921. value: 40374.224
  3922. }, {
  3923. name: 'Armenia',
  3924. value: 2963.496
  3925. }, {
  3926. name: 'French Southern and Antarctic Lands',
  3927. value: 268.065
  3928. }, {
  3929. name: 'Australia',
  3930. value: 22404.488
  3931. }, {
  3932. name: 'Austria',
  3933. value: 8401.924
  3934. }, {
  3935. name: 'Azerbaijan',
  3936. value: 9094.718
  3937. }, {
  3938. name: 'Burundi',
  3939. value: 9232.753
  3940. }, {
  3941. name: 'Belgium',
  3942. value: 10941.288
  3943. }, {
  3944. name: 'Benin',
  3945. value: 9509.798
  3946. }, {
  3947. name: 'Burkina Faso',
  3948. value: 15540.284
  3949. }, {
  3950. name: 'Bangladesh',
  3951. value: 151125.475
  3952. }, {
  3953. name: 'Bulgaria',
  3954. value: 7389.175
  3955. }, {
  3956. name: 'The Bahamas',
  3957. value: 66402.316
  3958. }, {
  3959. name: 'Bosnia and Herzegovina',
  3960. value: 3845.929
  3961. }, {
  3962. name: 'Belarus',
  3963. value: 9491.07
  3964. }, {
  3965. name: 'Belize',
  3966. value: 308.595
  3967. }, {
  3968. name: 'Bermuda',
  3969. value: 64.951
  3970. }, {
  3971. name: 'Bolivia',
  3972. value: 716.939
  3973. }, {
  3974. name: 'Brazil',
  3975. value: 195210.154
  3976. }, {
  3977. name: 'Brunei',
  3978. value: 27.223
  3979. }, {
  3980. name: 'Bhutan',
  3981. value: 716.939
  3982. }, {
  3983. name: 'Botswana',
  3984. value: 1969.341
  3985. }, {
  3986. name: 'Central African Republic',
  3987. value: 4349.921
  3988. }, {
  3989. name: 'Canada',
  3990. value: 34126.24
  3991. }, {
  3992. name: 'Switzerland',
  3993. value: 7830.534
  3994. }, {
  3995. name: 'Chile',
  3996. value: 17150.76
  3997. }, {
  3998. name: 'China',
  3999. value: 1359821.465
  4000. }, {
  4001. name: 'Ivory Coast',
  4002. value: 60508.978
  4003. }, {
  4004. name: 'Cameroon',
  4005. value: 20624.343
  4006. }, {
  4007. name: 'Democratic Republic of the Congo',
  4008. value: 62191.161
  4009. }, {
  4010. name: 'Republic of the Congo',
  4011. value: 3573.024
  4012. }, {
  4013. name: 'Colombia',
  4014. value: 46444.798
  4015. }, {
  4016. name: 'Costa Rica',
  4017. value: 4669.685
  4018. }, {
  4019. name: 'Cuba',
  4020. value: 11281.768
  4021. }, {
  4022. name: 'Northern Cyprus',
  4023. value: 1.468
  4024. }, {
  4025. name: 'Cyprus',
  4026. value: 1103.685
  4027. }, {
  4028. name: 'Czech Republic',
  4029. value: 10553.701
  4030. }, {
  4031. name: 'Germany',
  4032. value: 83017.404
  4033. }, {
  4034. name: 'Djibouti',
  4035. value: 834.036
  4036. }, {
  4037. name: 'Denmark',
  4038. value: 5550.959
  4039. }, {
  4040. name: 'Dominican Republic',
  4041. value: 10016.797
  4042. }, {
  4043. name: 'Algeria',
  4044. value: 37062.82
  4045. }, {
  4046. name: 'Ecuador',
  4047. value: 15001.072
  4048. }, {
  4049. name: 'Egypt',
  4050. value: 78075.705
  4051. }, {
  4052. name: 'Eritrea',
  4053. value: 5741.159
  4054. }, {
  4055. name: 'Spain',
  4056. value: 46182.038
  4057. }, {
  4058. name: 'Estonia',
  4059. value: 1298.533
  4060. }, {
  4061. name: 'Ethiopia',
  4062. value: 87095.281
  4063. }, {
  4064. name: 'Finland',
  4065. value: 5367.693
  4066. }, {
  4067. name: 'Fiji',
  4068. value: 860.559
  4069. }, {
  4070. name: 'Falkland Islands',
  4071. value: 49.581
  4072. }, {
  4073. name: 'France',
  4074. value: 63230.866
  4075. }, {
  4076. name: 'Gabon',
  4077. value: 1556.222
  4078. }, {
  4079. name: 'United Kingdom',
  4080. value: 62066.35
  4081. }, {
  4082. name: 'Georgia',
  4083. value: 4388.674
  4084. }, {
  4085. name: 'Ghana',
  4086. value: 24262.901
  4087. }, {
  4088. name: 'Guinea',
  4089. value: 10876.033
  4090. }, {
  4091. name: 'Gambia',
  4092. value: 1680.64
  4093. }, {
  4094. name: 'Guinea Bissau',
  4095. value: 10876.033
  4096. }, {
  4097. name: 'Equatorial Guinea',
  4098. value: 696.167
  4099. }, {
  4100. name: 'Greece',
  4101. value: 11109.999
  4102. }, {
  4103. name: 'Greenland',
  4104. value: 56.546
  4105. }, {
  4106. name: 'Guatemala',
  4107. value: 14341.576
  4108. }, {
  4109. name: 'French Guiana',
  4110. value: 231.169
  4111. }, {
  4112. name: 'Guyana',
  4113. value: 786.126
  4114. }, {
  4115. name: 'Honduras',
  4116. value: 7621.204
  4117. }, {
  4118. name: 'Croatia',
  4119. value: 4338.027
  4120. }, {
  4121. name: 'Haiti',
  4122. value: 9896.4
  4123. }, {
  4124. name: 'Hungary',
  4125. value: 10014.633
  4126. }, {
  4127. name: 'Indonesia',
  4128. value: 240676.485
  4129. }, {
  4130. name: 'India',
  4131. value: 1205624.648
  4132. }, {
  4133. name: 'Ireland',
  4134. value: 4467.561
  4135. }, {
  4136. name: 'Iran',
  4137. value: 240676.485
  4138. }, {
  4139. name: 'Iraq',
  4140. value: 30962.38
  4141. }, {
  4142. name: 'Iceland',
  4143. value: 318.042
  4144. }, {
  4145. name: 'Israel',
  4146. value: 7420.368
  4147. }, {
  4148. name: 'Italy',
  4149. value: 60508.978
  4150. }, {
  4151. name: 'Jamaica',
  4152. value: 2741.485
  4153. }, {
  4154. name: 'Jordan',
  4155. value: 6454.554
  4156. }, {
  4157. name: 'Japan',
  4158. value: 127352.833
  4159. }, {
  4160. name: 'Kazakhstan',
  4161. value: 15921.127
  4162. }, {
  4163. name: 'Kenya',
  4164. value: 40909.194
  4165. }, {
  4166. name: 'Kyrgyzstan',
  4167. value: 5334.223
  4168. }, {
  4169. name: 'Cambodia',
  4170. value: 14364.931
  4171. }, {
  4172. name: 'South Korea',
  4173. value: 51452.352
  4174. }, {
  4175. name: 'Kosovo',
  4176. value: 97.743
  4177. }, {
  4178. name: 'Kuwait',
  4179. value: 2991.58
  4180. }, {
  4181. name: 'Laos',
  4182. value: 6395.713
  4183. }, {
  4184. name: 'Lebanon',
  4185. value: 4341.092
  4186. }, {
  4187. name: 'Liberia',
  4188. value: 3957.99
  4189. }, {
  4190. name: 'Libya',
  4191. value: 6040.612
  4192. }, {
  4193. name: 'Sri Lanka',
  4194. value: 20758.779
  4195. }, {
  4196. name: 'Lesotho',
  4197. value: 2008.921
  4198. }, {
  4199. name: 'Lithuania',
  4200. value: 3068.457
  4201. }, {
  4202. name: 'Luxembourg',
  4203. value: 507.885
  4204. }, {
  4205. name: 'Latvia',
  4206. value: 2090.519
  4207. }, {
  4208. name: 'Morocco',
  4209. value: 31642.36
  4210. }, {
  4211. name: 'Moldova',
  4212. value: 103.619
  4213. }, {
  4214. name: 'Madagascar',
  4215. value: 21079.532
  4216. }, {
  4217. name: 'Mexico',
  4218. value: 117886.404
  4219. }, {
  4220. name: 'Macedonia',
  4221. value: 507.885
  4222. }, {
  4223. name: 'Mali',
  4224. value: 13985.961
  4225. }, {
  4226. name: 'Myanmar',
  4227. value: 51931.231
  4228. }, {
  4229. name: 'Montenegro',
  4230. value: 620.078
  4231. }, {
  4232. name: 'Mongolia',
  4233. value: 2712.738
  4234. }, {
  4235. name: 'Mozambique',
  4236. value: 23967.265
  4237. }, {
  4238. name: 'Mauritania',
  4239. value: 3609.42
  4240. }, {
  4241. name: 'Malawi',
  4242. value: 15013.694
  4243. }, {
  4244. name: 'Malaysia',
  4245. value: 28275.835
  4246. }, {
  4247. name: 'Namibia',
  4248. value: 2178.967
  4249. }, {
  4250. name: 'New Caledonia',
  4251. value: 246.379
  4252. }, {
  4253. name: 'Niger',
  4254. value: 15893.746
  4255. }, {
  4256. name: 'Nigeria',
  4257. value: 159707.78
  4258. }, {
  4259. name: 'Nicaragua',
  4260. value: 5822.209
  4261. }, {
  4262. name: 'Netherlands',
  4263. value: 16615.243
  4264. }, {
  4265. name: 'Norway',
  4266. value: 4891.251
  4267. }, {
  4268. name: 'Nepal',
  4269. value: 26846.016
  4270. }, {
  4271. name: 'New Zealand',
  4272. value: 4368.136
  4273. }, {
  4274. name: 'Oman',
  4275. value: 2802.768
  4276. }, {
  4277. name: 'Pakistan',
  4278. value: 173149.306
  4279. }, {
  4280. name: 'Panama',
  4281. value: 3678.128
  4282. }, {
  4283. name: 'Peru',
  4284. value: 29262.83
  4285. }, {
  4286. name: 'Philippines',
  4287. value: 93444.322
  4288. }, {
  4289. name: 'Papua New Guinea',
  4290. value: 6858.945
  4291. }, {
  4292. name: 'Poland',
  4293. value: 38198.754
  4294. }, {
  4295. name: 'Puerto Rico',
  4296. value: 3709.671
  4297. }, {
  4298. name: 'North Korea',
  4299. value: 1.468
  4300. }, {
  4301. name: 'Portugal',
  4302. value: 10589.792
  4303. }, {
  4304. name: 'Paraguay',
  4305. value: 6459.721
  4306. }, {
  4307. name: 'Qatar',
  4308. value: 1749.713
  4309. }, {
  4310. name: 'Romania',
  4311. value: 21861.476
  4312. }, {
  4313. name: 'Russia',
  4314. value: 21861.476
  4315. }, {
  4316. name: 'Rwanda',
  4317. value: 10836.732
  4318. }, {
  4319. name: 'Western Sahara',
  4320. value: 514.648
  4321. }, {
  4322. name: 'Saudi Arabia',
  4323. value: 27258.387
  4324. }, {
  4325. name: 'Sudan',
  4326. value: 35652.002
  4327. }, {
  4328. name: 'South Sudan',
  4329. value: 9940.929
  4330. }, {
  4331. name: 'Senegal',
  4332. value: 12950.564
  4333. }, {
  4334. name: 'Solomon Islands',
  4335. value: 526.447
  4336. }, {
  4337. name: 'Sierra Leone',
  4338. value: 5751.976
  4339. }, {
  4340. name: 'El Salvador',
  4341. value: 6218.195
  4342. }, {
  4343. name: 'Somaliland',
  4344. value: 9636.173
  4345. }, {
  4346. name: 'Somalia',
  4347. value: 9636.173
  4348. }, {
  4349. name: 'Republic of Serbia',
  4350. value: 3573.024
  4351. }, {
  4352. name: 'Suriname',
  4353. value: 524.96
  4354. }, {
  4355. name: 'Slovakia',
  4356. value: 5433.437
  4357. }, {
  4358. name: 'Slovenia',
  4359. value: 2054.232
  4360. }, {
  4361. name: 'Sweden',
  4362. value: 9382.297
  4363. }, {
  4364. name: 'Swaziland',
  4365. value: 1193.148
  4366. }, {
  4367. name: 'Syria',
  4368. value: 7830.534
  4369. }, {
  4370. name: 'Chad',
  4371. value: 11720.781
  4372. }, {
  4373. name: 'Togo',
  4374. value: 6306.014
  4375. }, {
  4376. name: 'Thailand',
  4377. value: 66402.316
  4378. }, {
  4379. name: 'Tajikistan',
  4380. value: 7627.326
  4381. }, {
  4382. name: 'Turkmenistan',
  4383. value: 5041.995
  4384. }, {
  4385. name: 'East Timor',
  4386. value: 10016.797
  4387. }, {
  4388. name: 'Trinidad and Tobago',
  4389. value: 1328.095
  4390. }, {
  4391. name: 'Tunisia',
  4392. value: 10631.83
  4393. }, {
  4394. name: 'Turkey',
  4395. value: 72137.546
  4396. }, {
  4397. name: 'United Republic of Tanzania',
  4398. value: 44973.33
  4399. }, {
  4400. name: 'Uganda',
  4401. value: 33987.213
  4402. }, {
  4403. name: 'Ukraine',
  4404. value: 46050.22
  4405. }, {
  4406. name: 'Uruguay',
  4407. value: 3371.982
  4408. }, {
  4409. name: 'United States of America',
  4410. value: 312247.116
  4411. }, {
  4412. name: 'Uzbekistan',
  4413. value: 27769.27
  4414. }, {
  4415. name: 'Venezuela',
  4416. value: 236.299
  4417. }, {
  4418. name: 'Vietnam',
  4419. value: 89047.397
  4420. }, {
  4421. name: 'Vanuatu',
  4422. value: 236.299
  4423. }, {
  4424. name: 'West Bank',
  4425. value: 13.565
  4426. }, {
  4427. name: 'Yemen',
  4428. value: 22763.008
  4429. }, {
  4430. name: 'South Africa',
  4431. value: 51452.352
  4432. }, {
  4433. name: 'Zambia',
  4434. value: 13216.985
  4435. }, {
  4436. name: 'Zimbabwe',
  4437. value: 13076.978
  4438. }]
  4439. }]
  4440. });
  4441. }
  4442. }
  4443. $(document).ready(function() {
  4444. init_sparklines();
  4445. init_flot_chart();
  4446. init_sidebar();
  4447. init_wysiwyg();
  4448. init_InputMask();
  4449. init_JQVmap();
  4450. init_cropper();
  4451. init_knob();
  4452. init_IonRangeSlider();
  4453. init_ColorPicker();
  4454. init_TagsInput();
  4455. init_parsley();
  4456. init_daterangepicker();
  4457. init_daterangepicker_right();
  4458. init_daterangepicker_single_call();
  4459. init_daterangepicker_reservation();
  4460. init_SmartWizard();
  4461. init_EasyPieChart();
  4462. init_charts();
  4463. init_echarts();
  4464. init_morris_charts();
  4465. init_skycons();
  4466. init_select2();
  4467. init_validator();
  4468. init_DataTables();
  4469. init_chart_doughnut();
  4470. init_gauge();
  4471. init_PNotify();
  4472. init_starrr();
  4473. init_calendar();
  4474. init_compose();
  4475. init_CustomNotification();
  4476. init_autosize();
  4477. init_autocomplete();
  4478. });