"}),e.html(r)}var n=$(this._chart.canvas),s=(n.outerWidth(),n.outerHeight(),n.offset().top),i=n.offset().left,l=e.outerWidth(),c=e.outerHeight(),d=s+t.caretY-c-16,u=i+t.caretX-l/2;e.css({top:d+"px",left:u+"px",display:"block"})}else e.css("display","none")},callbacks:{label:function(t,e){var o=e.datasets[t.datasetIndex].label||"",a=t.yLabel,r="";return 1'+o+""),r+''+a+""}}}},i={cutoutPercentage:83,tooltips:{callbacks:{title:function(t,e){return e.labels[t[0].index]},label:function(t,e){return""+''+e.datasets[0].data[t.index]+""}}},legendCallback:function(t){var e=t.data,o="";return e.labels.forEach(function(t,a){var r=e.datasets[0].backgroundColor[a];o+='',o+='',o+=t,o+=""}),o}},l={settings:settings,init:function(){a(Chart,{defaults:{global:s,doughnut:i}}),Chart.scaleService.updateScaleDefaults("linear",{gridLines:{borderDash:[2],borderDashOffset:[2],color:"dark"==settings.charts.colorScheme?settings.colors.gray[900]:settings.colors.gray[100],drawBorder:!1,drawTicks:!1,lineWidth:0,zeroLineWidth:0,zeroLineColor:"dark"==settings.charts.colorScheme?settings.colors.gray[900]:settings.colors.gray[100],zeroLineBorderDash:[2],zeroLineBorderDashOffset:[2]},ticks:{beginAtZero:!0,padding:10,callback:function(t){if(!(t%10))return t}}}),Chart.scaleService.updateScaleDefaults("category",{gridLines:{drawBorder:!1,drawOnChartArea:!1,drawTicks:!1},ticks:{padding:20},maxBarThickness:10}),$('[data-toggle="chart"]').on({change:function(){var t=$(this);t.is("[data-add]")&&r(t)},click:function(){var t=$(this);t.is("[data-update]")&&n(t)}})},add:r,update:n,create:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"line",o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},a=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},r=$(t),n=new Chart(r,{type:e,options:o,data:a});r.data("chart",n),r.data("chart-legend")&&(document.querySelector(r.data("chart-legend")).innerHTML=n.generateLegend())}};void 0!==window&&(window.Charts=l)}});