1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063 |
- /*!
-
- =========================================================
- * Argon Dashboard - v1.0.0
- =========================================================
-
- * Product Page: https://www.creative-tim.com/product/argon-dashboard
- * Copyright 2018 Creative Tim (https://www.creative-tim.com) & UPDIVISION (https://www.updivision.com)
- * Licensed under MIT (https://github.com/creativetimofficial/argon-dashboard/blob/master/LICENSE.md)
-
- * Coded by www.creative-tim.com & www.updivision.com
-
- =========================================================
-
- * The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
-
- */
-
- //
- // Bootstrap Datepicker
- //
-
- 'use strict';
-
- var Datepicker = (function() {
-
- // Variables
-
- var $datepicker = $('.datepicker');
-
-
- // Methods
-
- function init($this) {
- var options = {
- disableTouchKeyboard: true,
- autoclose: false
- };
-
- $this.datepicker(options);
- }
-
-
- // Events
-
- if ($datepicker.length) {
- $datepicker.each(function() {
- init($(this));
- });
- }
-
- })();
-
- //
- // Icon code copy/paste
- //
-
- 'use strict';
-
- var CopyIcon = (function() {
-
- // Variables
-
- var $element = '.btn-icon-clipboard',
- $btn = $($element);
-
-
- // Methods
-
- function init($this) {
- $this.tooltip().on('mouseleave', function() {
- // Explicitly hide tooltip, since after clicking it remains
- // focused (as it's a button), so tooltip would otherwise
- // remain visible until focus is moved away
- $this.tooltip('hide');
- });
-
- var clipboard = new ClipboardJS($element);
-
- clipboard.on('success', function(e) {
- $(e.trigger)
- .attr('title', 'Copied!')
- .tooltip('_fixTitle')
- .tooltip('show')
- .attr('title', 'Copy to clipboard')
- .tooltip('_fixTitle')
-
- e.clearSelection()
- });
- }
-
-
- // Events
- if ($btn.length) {
- init($btn);
- }
-
- })();
-
- //
- // Form control
- //
-
- 'use strict';
-
- var FormControl = (function() {
-
- // Variables
-
- var $input = $('.form-control');
-
-
- // Methods
-
- function init($this) {
- $this.on('focus blur', function(e) {
- $(this).parents('.form-group').toggleClass('focused', (e.type === 'focus' || this.value.length > 0));
- }).trigger('blur');
- }
-
-
- // Events
-
- if ($input.length) {
- init($input);
- }
-
- })();
-
- //
- // Google maps
- //
-
- var $map = $('#map-canvas'),
- map,
- lat,
- lng,
- color = "#5e72e4";
-
- function initMap() {
-
- map = document.getElementById('map-canvas');
- lat = map.getAttribute('data-lat');
- lng = map.getAttribute('data-lng');
-
- var myLatlng = new google.maps.LatLng(lat, lng);
- var mapOptions = {
- zoom: 12,
- scrollwheel: false,
- center: myLatlng,
- mapTypeId: google.maps.MapTypeId.ROADMAP,
- styles: [{"featureType":"administrative","elementType":"labels.text.fill","stylers":[{"color":"#444444"}]},{"featureType":"landscape","elementType":"all","stylers":[{"color":"#f2f2f2"}]},{"featureType":"poi","elementType":"all","stylers":[{"visibility":"off"}]},{"featureType":"road","elementType":"all","stylers":[{"saturation":-100},{"lightness":45}]},{"featureType":"road.highway","elementType":"all","stylers":[{"visibility":"simplified"}]},{"featureType":"road.arterial","elementType":"labels.icon","stylers":[{"visibility":"off"}]},{"featureType":"transit","elementType":"all","stylers":[{"visibility":"off"}]},{"featureType":"water","elementType":"all","stylers":[{"color":color},{"visibility":"on"}]}]
- }
-
- map = new google.maps.Map(map, mapOptions);
-
- var marker = new google.maps.Marker({
- position: myLatlng,
- map: map,
- animation: google.maps.Animation.DROP,
- title: 'Hello World!'
- });
-
- var contentString = '<div class="info-window-content"><h2>Argon Dashboard</h2>' +
- '<p>A beautiful Dashboard for Bootstrap 4. It is Free and Open Source.</p></div>';
-
- var infowindow = new google.maps.InfoWindow({
- content: contentString
- });
-
- google.maps.event.addListener(marker, 'click', function() {
- infowindow.open(map, marker);
- });
- }
-
- if($map.length) {
- google.maps.event.addDomListener(window, 'load', initMap);
- }
-
- // //
- // // Headroom - show/hide navbar on scroll
- // //
- //
- // 'use strict';
- //
- // var Headroom = (function() {
- //
- // // Variables
- //
- // var $headroom = $('#navbar-main');
- //
- //
- // // Methods
- //
- // function init($this) {
- //
- // var headroom = new Headroom(document.querySelector("#navbar-main"), {
- // offset: 300,
- // tolerance: {
- // up: 30,
- // down: 30
- // },
- // });
- //
- //
- //
- // // Events
- //
- // if ($headroom.length) {
- // headroom.init();
- // }
- //
- // })();
-
- //
- // Navbar
- //
-
- 'use strict';
-
- var Navbar = (function() {
-
- // Variables
-
- var $nav = $('.navbar-nav, .navbar-nav .nav');
- var $collapse = $('.navbar .collapse');
- var $dropdown = $('.navbar .dropdown');
-
- // Methods
-
- function accordion($this) {
- $this.closest($nav).find($collapse).not($this).collapse('hide');
- }
-
- function closeDropdown($this) {
- var $dropdownMenu = $this.find('.dropdown-menu');
-
- $dropdownMenu.addClass('close');
-
- setTimeout(function() {
- $dropdownMenu.removeClass('close');
- }, 200);
- }
-
-
- // Events
-
- $collapse.on({
- 'show.bs.collapse': function() {
- accordion($(this));
- }
- })
-
- $dropdown.on({
- 'hide.bs.dropdown': function() {
- closeDropdown($(this));
- }
- })
-
- })();
-
-
- //
- // Navbar collapse
- //
-
-
- var NavbarCollapse = (function() {
-
- // Variables
-
- var $nav = $('.navbar-nav'),
- $collapse = $('.navbar .collapse');
-
-
- // Methods
-
- function hideNavbarCollapse($this) {
- $this.addClass('collapsing-out');
- }
-
- function hiddenNavbarCollapse($this) {
- $this.removeClass('collapsing-out');
- }
-
-
- // Events
-
- if ($collapse.length) {
- $collapse.on({
- 'hide.bs.collapse': function() {
- hideNavbarCollapse($collapse);
- }
- })
-
- $collapse.on({
- 'hidden.bs.collapse': function() {
- hiddenNavbarCollapse($collapse);
- }
- })
- }
-
- })();
-
- //
- // Form control
- //
-
- 'use strict';
-
- var noUiSlider = (function() {
-
- // Variables
-
- // var $sliderContainer = $('.input-slider-container'),
- // $slider = $('.input-slider'),
- // $sliderId = $slider.attr('id'),
- // $sliderMinValue = $slider.data('range-value-min');
- // $sliderMaxValue = $slider.data('range-value-max');;
-
-
- // // Methods
- //
- // function init($this) {
- // $this.on('focus blur', function(e) {
- // $this.parents('.form-group').toggleClass('focused', (e.type === 'focus' || this.value.length > 0));
- // }).trigger('blur');
- // }
- //
- //
- // // Events
- //
- // if ($input.length) {
- // init($input);
- // }
-
-
-
- if ($(".input-slider-container")[0]) {
- $('.input-slider-container').each(function() {
-
- var slider = $(this).find('.input-slider');
- var sliderId = slider.attr('id');
- var minValue = slider.data('range-value-min');
- var maxValue = slider.data('range-value-max');
-
- var sliderValue = $(this).find('.range-slider-value');
- var sliderValueId = sliderValue.attr('id');
- var startValue = sliderValue.data('range-value-low');
-
- var c = document.getElementById(sliderId),
- d = document.getElementById(sliderValueId);
-
- noUiSlider.create(c, {
- start: [parseInt(startValue)],
- connect: [true, false],
- //step: 1000,
- range: {
- 'min': [parseInt(minValue)],
- 'max': [parseInt(maxValue)]
- }
- });
-
- c.noUiSlider.on('update', function(a, b) {
- d.textContent = a[b];
- });
- })
- }
-
- if ($("#input-slider-range")[0]) {
- var c = document.getElementById("input-slider-range"),
- d = document.getElementById("input-slider-range-value-low"),
- e = document.getElementById("input-slider-range-value-high"),
- f = [d, e];
-
- noUiSlider.create(c, {
- start: [parseInt(d.getAttribute('data-range-value-low')), parseInt(e.getAttribute('data-range-value-high'))],
- connect: !0,
- range: {
- min: parseInt(c.getAttribute('data-range-value-min')),
- max: parseInt(c.getAttribute('data-range-value-max'))
- }
- }), c.noUiSlider.on("update", function(a, b) {
- f[b].textContent = a[b]
- })
- }
-
- })();
-
- //
- // Popover
- //
-
- 'use strict';
-
- var Popover = (function() {
-
- // Variables
-
- var $popover = $('[data-toggle="popover"]'),
- $popoverClass = '';
-
-
- // Methods
-
- function init($this) {
- if ($this.data('color')) {
- $popoverClass = 'popover-' + $this.data('color');
- }
-
- var options = {
- trigger: 'focus',
- template: '<div class="popover ' + $popoverClass + '" role="tooltip"><div class="arrow"></div><h3 class="popover-header"></h3><div class="popover-body"></div></div>'
- };
-
- $this.popover(options);
- }
-
-
- // Events
-
- if ($popover.length) {
- $popover.each(function() {
- init($(this));
- });
- }
-
- })();
-
- //
- // Scroll to (anchor links)
- //
-
- 'use strict';
-
- var ScrollTo = (function() {
-
- //
- // Variables
- //
-
- var $scrollTo = $('.scroll-me, [data-scroll-to], .toc-entry a');
-
-
- //
- // Methods
- //
-
- function scrollTo($this) {
- var $el = $this.attr('href');
- var offset = $this.data('scroll-to-offset') ? $this.data('scroll-to-offset') : 0;
- var options = {
- scrollTop: $($el).offset().top - offset
- };
-
- // Animate scroll to the selected section
- $('html, body').stop(true, true).animate(options, 600);
-
- event.preventDefault();
- }
-
-
- //
- // Events
- //
-
- if ($scrollTo.length) {
- $scrollTo.on('click', function(event) {
- scrollTo($(this));
- });
- }
-
- })();
-
- //
- // Tooltip
- //
-
- 'use strict';
-
- var Tooltip = (function() {
-
- // Variables
-
- var $tooltip = $('[data-toggle="tooltip"]');
-
-
- // Methods
-
- function init() {
- $tooltip.tooltip();
- }
-
-
- // Events
-
- if ($tooltip.length) {
- init();
- }
-
- })();
-
- //
- // Charts
- //
-
- 'use strict';
-
- var Charts = (function() {
-
- // Variable
-
- var $toggle = $('[data-toggle="chart"]');
- var mode = 'light';//(themeMode) ? themeMode : 'light';
- var fonts = {
- base: 'Open Sans'
- }
-
- // Colors
- var colors = {
- gray: {
- 100: '#f6f9fc',
- 200: '#e9ecef',
- 300: '#dee2e6',
- 400: '#ced4da',
- 500: '#adb5bd',
- 600: '#8898aa',
- 700: '#525f7f',
- 800: '#32325d',
- 900: '#212529'
- },
- theme: {
- 'default': '#172b4d',
- 'primary': '#5e72e4',
- 'secondary': '#f4f5f7',
- 'info': '#11cdef',
- 'success': '#2dce89',
- 'danger': '#f5365c',
- 'warning': '#fb6340'
- },
- black: '#12263F',
- white: '#FFFFFF',
- transparent: 'transparent',
- };
-
-
- // Methods
-
- // Chart.js global options
- function chartOptions() {
-
- // Options
- var options = {
- defaults: {
- global: {
- responsive: true,
- maintainAspectRatio: false,
- defaultColor: (mode == 'dark') ? colors.gray[700] : colors.gray[600],
- defaultFontColor: (mode == 'dark') ? colors.gray[700] : colors.gray[600],
- defaultFontFamily: fonts.base,
- defaultFontSize: 13,
- layout: {
- padding: 0
- },
- legend: {
- display: false,
- position: 'bottom',
- labels: {
- usePointStyle: true,
- padding: 16
- }
- },
- elements: {
- point: {
- radius: 0,
- backgroundColor: colors.theme['primary']
- },
- line: {
- tension: .4,
- borderWidth: 4,
- borderColor: colors.theme['primary'],
- backgroundColor: colors.transparent,
- borderCapStyle: 'rounded'
- },
- rectangle: {
- backgroundColor: colors.theme['warning']
- },
- arc: {
- backgroundColor: colors.theme['primary'],
- borderColor: (mode == 'dark') ? colors.gray[800] : colors.white,
- borderWidth: 4
- }
- },
- tooltips: {
- enabled: false,
- mode: 'index',
- intersect: false,
- custom: function(model) {
-
- // Get tooltip
- var $tooltip = $('#chart-tooltip');
-
- // Create tooltip on first render
- if (!$tooltip.length) {
- $tooltip = $('<div id="chart-tooltip" class="popover bs-popover-top" role="tooltip"></div>');
-
- // Append to body
- $('body').append($tooltip);
- }
-
- // Hide if no tooltip
- if (model.opacity === 0) {
- $tooltip.css('display', 'none');
- return;
- }
-
- function getBody(bodyItem) {
- return bodyItem.lines;
- }
-
- // Fill with content
- if (model.body) {
- var titleLines = model.title || [];
- var bodyLines = model.body.map(getBody);
- var html = '';
-
- // Add arrow
- html += '<div class="arrow"></div>';
-
- // Add header
- titleLines.forEach(function(title) {
- html += '<h3 class="popover-header text-center">' + title + '</h3>';
- });
-
- // Add body
- bodyLines.forEach(function(body, i) {
- var colors = model.labelColors[i];
- var styles = 'background-color: ' + colors.backgroundColor;
- var indicator = '<span class="badge badge-dot"><i class="bg-primary"></i></span>';
- var align = (bodyLines.length > 1) ? 'justify-content-left' : 'justify-content-center';
- html += '<div class="popover-body d-flex align-items-center ' + align + '">' + indicator + body + '</div>';
- });
-
- $tooltip.html(html);
- }
-
- // Get tooltip position
- var $canvas = $(this._chart.canvas);
-
- var canvasWidth = $canvas.outerWidth();
- var canvasHeight = $canvas.outerHeight();
-
- var canvasTop = $canvas.offset().top;
- var canvasLeft = $canvas.offset().left;
-
- var tooltipWidth = $tooltip.outerWidth();
- var tooltipHeight = $tooltip.outerHeight();
-
- var top = canvasTop + model.caretY - tooltipHeight - 16;
- var left = canvasLeft + model.caretX - tooltipWidth / 2;
-
- // Display tooltip
- $tooltip.css({
- 'top': top + 'px',
- 'left': left + 'px',
- 'display': 'block',
- 'z-index': '100'
- });
-
- },
- callbacks: {
- label: function(item, data) {
- var label = data.datasets[item.datasetIndex].label || '';
- var yLabel = item.yLabel;
- var content = '';
-
- if (data.datasets.length > 1) {
- content += '<span class="badge badge-primary mr-auto">' + label + '</span>';
- }
-
- content += '<span class="popover-body-value">' + yLabel + '</span>' ;
- return content;
- }
- }
- }
- },
- doughnut: {
- cutoutPercentage: 83,
- tooltips: {
- callbacks: {
- title: function(item, data) {
- var title = data.labels[item[0].index];
- return title;
- },
- label: function(item, data) {
- var value = data.datasets[0].data[item.index];
- var content = '';
-
- content += '<span class="popover-body-value">' + value + '</span>';
- return content;
- }
- }
- },
- legendCallback: function(chart) {
- var data = chart.data;
- var content = '';
-
- data.labels.forEach(function(label, index) {
- var bgColor = data.datasets[0].backgroundColor[index];
-
- content += '<span class="chart-legend-item">';
- content += '<i class="chart-legend-indicator" style="background-color: ' + bgColor + '"></i>';
- content += label;
- content += '</span>';
- });
-
- return content;
- }
- }
- }
- }
-
- // yAxes
- Chart.scaleService.updateScaleDefaults('linear', {
- gridLines: {
- borderDash: [2],
- borderDashOffset: [2],
- color: (mode == 'dark') ? colors.gray[900] : colors.gray[300],
- drawBorder: false,
- drawTicks: false,
- lineWidth: 0,
- zeroLineWidth: 0,
- zeroLineColor: (mode == 'dark') ? colors.gray[900] : colors.gray[300],
- zeroLineBorderDash: [2],
- zeroLineBorderDashOffset: [2]
- },
- ticks: {
- beginAtZero: true,
- padding: 10,
- callback: function(value) {
- if (!(value % 10)) {
- return value
- }
- }
- }
- });
-
- // xAxes
- Chart.scaleService.updateScaleDefaults('category', {
- gridLines: {
- drawBorder: false,
- drawOnChartArea: false,
- drawTicks: false
- },
- ticks: {
- padding: 20
- },
- maxBarThickness: 10
- });
-
- return options;
-
- }
-
- // Parse global options
- function parseOptions(parent, options) {
- for (var item in options) {
- if (typeof options[item] !== 'object') {
- parent[item] = options[item];
- } else {
- parseOptions(parent[item], options[item]);
- }
- }
- }
-
- // Push options
- function pushOptions(parent, options) {
- for (var item in options) {
- if (Array.isArray(options[item])) {
- options[item].forEach(function(data) {
- parent[item].push(data);
- });
- } else {
- pushOptions(parent[item], options[item]);
- }
- }
- }
-
- // Pop options
- function popOptions(parent, options) {
- for (var item in options) {
- if (Array.isArray(options[item])) {
- options[item].forEach(function(data) {
- parent[item].pop();
- });
- } else {
- popOptions(parent[item], options[item]);
- }
- }
- }
-
- // Toggle options
- function toggleOptions(elem) {
- var options = elem.data('add');
- var $target = $(elem.data('target'));
- var $chart = $target.data('chart');
-
- if (elem.is(':checked')) {
-
- // Add options
- pushOptions($chart, options);
-
- // Update chart
- $chart.update();
- } else {
-
- // Remove options
- popOptions($chart, options);
-
- // Update chart
- $chart.update();
- }
- }
-
- // Update options
- function updateOptions(elem) {
- var options = elem.data('update');
- var $target = $(elem.data('target'));
- var $chart = $target.data('chart');
-
- // Parse options
- parseOptions($chart, options);
-
- // Toggle ticks
- toggleTicks(elem, $chart);
-
- // Update chart
- $chart.update();
- }
-
- // Toggle ticks
- function toggleTicks(elem, $chart) {
-
- if (elem.data('prefix') !== undefined || elem.data('prefix') !== undefined) {
- var prefix = elem.data('prefix') ? elem.data('prefix') : '';
- var suffix = elem.data('suffix') ? elem.data('suffix') : '';
-
- // Update ticks
- $chart.options.scales.yAxes[0].ticks.callback = function(value) {
- if (!(value % 10)) {
- return prefix + value + suffix;
- }
- }
-
- // Update tooltips
- $chart.options.tooltips.callbacks.label = function(item, data) {
- var label = data.datasets[item.datasetIndex].label || '';
- var yLabel = item.yLabel;
- var content = '';
-
- if (data.datasets.length > 1) {
- content += '<span class="popover-body-label mr-auto">' + label + '</span>';
- }
-
- content += '<span class="popover-body-value">' + prefix + yLabel + suffix + '</span>';
- return content;
- }
-
- }
- }
-
-
- // Events
-
- // Parse global options
- if (window.Chart) {
- parseOptions(Chart, chartOptions());
- }
-
- // Toggle options
- $toggle.on({
- 'change': function() {
- var $this = $(this);
-
- if ($this.is('[data-add]')) {
- toggleOptions($this);
- }
- },
- 'click': function() {
- var $this = $(this);
-
- if ($this.is('[data-update]')) {
- updateOptions($this);
- }
- }
- });
-
-
- // Return
-
- return {
- colors: colors,
- fonts: fonts,
- mode: mode
- };
-
- })();
-
- //
- // Orders chart
- //
-
- var OrdersChart = (function() {
-
- //
- // Variables
- //
-
- var $chart = $('#chart-orders');
- var $ordersSelect = $('[name="ordersSelect"]');
-
-
- //
- // Methods
- //
-
- // Init chart
- function initChart($chart) {
-
- // Create chart
- var ordersChart = new Chart($chart, {
- type: 'bar',
- options: {
- scales: {
- yAxes: [{
- ticks: {
- callback: function(value) {
- if (!(value % 10)) {
- //return '$' + value + 'k'
- return value
- }
- }
- }
- }]
- },
- tooltips: {
- callbacks: {
- label: function(item, data) {
- var label = data.datasets[item.datasetIndex].label || '';
- var yLabel = item.yLabel;
- var content = '';
-
- if (data.datasets.length > 1) {
- content += '<span class="popover-body-label mr-auto">' + label + '</span>';
- }
-
- content += '<span class="popover-body-value">' + yLabel + '</span>';
-
- return content;
- }
- }
- }
- },
- data: {
- labels: ['Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'],
- datasets: [{
- label: 'Sales',
- data: [25, 20, 30, 22, 17, 29]
- }]
- }
- });
-
- // Save to jQuery object
- $chart.data('chart', ordersChart);
- }
-
-
- // Init chart
- if ($chart.length) {
- initChart($chart);
- }
-
- })();
-
- //
- // Charts
- //
-
- 'use strict';
-
- //
- // Sales chart
- //
-
- var SalesChart = (function() {
-
- // Variables
-
- var $chart = $('#chart-sales');
-
-
- // Methods
-
- function init($chart) {
-
- var salesChart = new Chart($chart, {
- type: 'line',
- options: {
- scales: {
- yAxes: [{
- gridLines: {
- color: Charts.colors.gray[900],
- zeroLineColor: Charts.colors.gray[900]
- },
- ticks: {
- callback: function(value) {
- if (!(value % 10)) {
- return '$' + value + 'k';
- }
- }
- }
- }]
- },
- tooltips: {
- callbacks: {
- label: function(item, data) {
- var label = data.datasets[item.datasetIndex].label || '';
- var yLabel = item.yLabel;
- var content = '';
-
- if (data.datasets.length > 1) {
- content += '<span class="popover-body-label mr-auto">' + label + '</span>';
- }
-
- content += '<span class="popover-body-value">$' + yLabel + 'k</span>';
- return content;
- }
- }
- }
- },
- data: {
- labels: ['May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'],
- datasets: [{
- label: 'Performance',
- data: [0, 20, 10, 30, 15, 40, 20, 60, 60]
- }]
- }
- });
-
- // Save to jQuery object
-
- $chart.data('chart', salesChart);
-
- };
-
-
- // Events
-
- if ($chart.length) {
- init($chart);
- }
-
- })();
|