%PDF- %PDF-
Direktori : /var/softaculous/sitepad/editor/site-data/plugins/kkart-pro/assets/js/admin/ |
Current File : //var/softaculous/sitepad/editor/site-data/plugins/kkart-pro/assets/js/admin/reports.min.js |
jQuery(function(p){function r(t,e,a){p('<div class="chart-tooltip">'+a+"</div>").css({top:e-16,left:t+20}).appendTo("body").fadeIn(200)}var o=null,s=null;p(".chart-placeholder").bind("plothover",function(t,e,a){var n,i;a?o===a.dataIndex&&s===a.seriesIndex||(o=a.dataIndex,s=a.seriesIndex,p(".chart-tooltip").remove(),(a.series.points.show||a.series.enable_tooltip)&&(n=a.series.data[a.dataIndex][1],i="",a.series.prepend_label&&(i=i+a.series.label+": "),a.series.prepend_tooltip&&(i+=a.series.prepend_tooltip),i+=n,a.series.append_tooltip&&(i+=a.series.append_tooltip),a.series.pie.show?r(e.pageX,e.pageY,i):r(a.pageX,a.pageY,i))):(p(".chart-tooltip").remove(),o=null)}),p(".kkart_sparkline.bars").each(function(){var t=[{data:p(this).data("sparkline"),color:p(this).data("color"),bars:{fillColor:p(this).data("color"),fill:!0,show:!0,lineWidth:1,barWidth:p(this).data("barwidth"),align:"center"},shadowSize:0}];p.plot(p(this),t,{grid:{show:!1}})}),p(".kkart_sparkline.lines").each(function(){var t=[{data:p(this).data("sparkline"),color:p(this).data("color"),lines:{fill:!1,show:!0,lineWidth:1,align:"center"},shadowSize:0}];p.plot(p(this),t,{grid:{show:!1}})});var a=p(".range_datepicker").datepicker({changeMonth:!0,changeYear:!0,defaultDate:"",dateFormat:"yy-mm-dd",numberOfMonths:1,minDate:"-20Y",maxDate:"+1D",showButtonPanel:!0,showOn:"focus",buttonImageOnly:!0,onSelect:function(){var t=p(this).is(".from")?"minDate":"maxDate",e=p(this).datepicker("getDate");a.not(this).datepicker("option",t,e)}});"undefined"==typeof document.createElement("a").download&&p(".export_csv").hide(),p(".export_csv").click(function(){var a=p(this).data("exclude_series")||"";a=(a=a.toString()).split(",");var t,e,n=p(this).data("xaxes"),r=p(this).data("groupby"),o=p(this).data("index_type"),i=p(this).data("export"),s="";if("table"===i)p(this).offsetParent().find("thead tr,tbody tr").each(function(){p(this).find("th, td").each(function(){var t=(t=p(this).text()).replace("[?]","").replace("#","");s+='"'+t+'",'}),s=s.substring(0,s.length-1),s+="\n"}),p(this).offsetParent().find("tfoot tr").each(function(){p(this).find("th, td").each(function(){var t=(t=p(this).text()).replace("[?]","").replace("#","");if(s+='"'+t+'",',0<p(this).attr("colspan"))for(c=1;c<p(this).attr("colspan");c++)s+='"",'}),s=s.substring(0,s.length-1),s+="\n"});else{if(!window.main_chart)return!1;var i=window.main_chart.getData(),l=[];for(s+='"'+n+'",',p.each(i,function(t,e){a&&-1!==p.inArray(t.toString(),a)||l.push(e)}),d=0;d<l.length;++d)s+='"'+l[d].label+'",';s=s.substring(0,s.length-1),s+="\n";for(var h={},d=0;d<l.length;++d)for(t=l[d].data,e=0;e<t.length;++e){h[t[e][0]]=[];for(var c=0;c<l.length;++c)h[t[e][0]].push(0)}for(d=0;d<l.length;++d)for(t=l[d].data,e=0;e<t.length;++e)h[t[e][0]][d]=t[e][1];p.each(h,function(t,e){var a=new Date(parseInt(t,10));s+="none"===o?'"'+t+'",':"day"===r?'"'+a.getUTCFullYear()+"-"+parseInt(a.getUTCMonth()+1,10)+"-"+a.getUTCDate()+'",':'"'+a.getUTCFullYear()+"-"+parseInt(a.getUTCMonth()+1,10)+'",';for(var n=0;n<e.length;++n){var i=e[n];Math.round(i)!==i&&(i=(i=parseFloat(i)).toFixed(2)),s+='"'+i+'",'}s=s.substring(0,s.length-1),s+="\n"})}return s="data:text/csv;charset=utf-8,\ufeff"+encodeURIComponent(s),p(this).attr("href",s),!0})});