/* * File: jquery.barfiller.js * Version: 1.0.1 * Description: A plugin that fills bars with a percentage you set. * Author: 9bit Studios * Copyright 2012, 9bit Studios * http://www.9bitstudios.com * Free to use and abuse under the MIT license. * http://www.opensource.org/licenses/mit-license.php */ (function ($) { $.fn.barfiller = function (options) { var defaults = $.extend({ barColor: '#16b597', tooltip: true, duration: 1000, animateOnResize: true, symbol: "%" }, options); /****************************** Private Variables *******************************/ var object = $(this); var settings = $.extend(defaults, options); var barWidth = object.width(); var fill = object.find('.fill'); var toolTip = object.find('.tip'); var fillPercentage = fill.attr('data-percentage'); var resizeTimeout; var transitionSupport = false; var transitionPrefix; /****************************** Public Methods *******************************/ var methods = { init: function() { return this.each(function () { if(methods.getTransitionSupport()) { transitionSupport = true; transitionPrefix = methods.getTransitionPrefix(); } methods.appendHTML(); methods.setEventHandlers(); methods.initializeItems(); }); }, /****************************** Append HTML *******************************/ appendHTML: function() { fill.css('background', settings.barColor); if(!settings.tooltip) { toolTip.css('display', 'none'); } toolTip.text(fillPercentage + settings.symbol); }, /****************************** Set Event Handlers *******************************/ setEventHandlers: function() { if(settings.animateOnResize) { $(window).on("resize", function(event){ clearTimeout(resizeTimeout); resizeTimeout = setTimeout(function() { methods.refill(); }, 300); }); } }, /****************************** Initialize *******************************/ initializeItems: function() { var pctWidth = methods.calculateFill(fillPercentage); object.find('.tipWrap').css({ display: 'inline' }); if(transitionSupport) methods.transitionFill(pctWidth); else methods.animateFill(pctWidth); }, getTransitionSupport: function() { var thisBody = document.body || document.documentElement, thisStyle = thisBody.style; var support = thisStyle.transition !== undefined || thisStyle.WebkitTransition !== undefined || thisStyle.MozTransition !== undefined || thisStyle.MsTransition !== undefined || thisStyle.OTransition !== undefined; return support; }, getTransitionPrefix: function() { if(/mozilla/.test(navigator.userAgent.toLowerCase()) && !/webkit/.test(navigator.userAgent.toLowerCase())) { return '-moz-transition'; } if(/webkit/.test(navigator.userAgent.toLowerCase())) { return '-webkit-transition'; } if(/opera/.test(navigator.userAgent.toLowerCase())) { return '-o-transition'; } if (/msie/.test(navigator.userAgent.toLowerCase())) { return '-ms-transition'; } else { return 'transition'; } }, getTransition: function(val, time, type) { var CSSObj; if(type === 'width') { CSSObj = { width : val }; } else if (type === 'left') { CSSObj = { left: val }; } time = time/1000; CSSObj[transitionPrefix] = type+' '+time+'s ease-in-out'; return CSSObj; }, refill: function() { fill.css('width', 0); toolTip.css('left', 0); barWidth = object.width(); methods.initializeItems(); }, calculateFill: function(percentage) { percentage = percentage * 0.01; var finalWidth = barWidth * percentage; return finalWidth; }, transitionFill: function(barWidth) { var toolTipOffset = barWidth - toolTip.width(); fill.css( methods.getTransition(barWidth, settings.duration, 'width')); toolTip.css( methods.getTransition(toolTipOffset, settings.duration, 'left')); }, animateFill: function(barWidth) { var toolTipOffset = barWidth - toolTip.width(); fill.stop().animate({width: '+=' + barWidth}, settings.duration); toolTip.stop().animate({left: '+=' + toolTipOffset}, settings.duration); } }; if (methods[options]) { // $("#element").pluginName('methodName', 'arg1', 'arg2'); return methods[options].apply(this, Array.prototype.slice.call(arguments, 1)); } else if (typeof options === 'object' || !options) { // $("#element").pluginName({ option: 1, option:2 }); return methods.init.apply(this); } else { $.error( 'Method "' + method + '" does not exist in barfiller plugin!'); } }; })(jQuery); /* jQuery Graph Plugin */ "use strict";var Graph=Graph||function(t){var i={};i.count=0;var e=function(t){0!==t&&(i.setOptions.call(this,t),++i.count)};return i.defaults=function(){return{x:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],y:10,attachTo:"body",points:[0,26,33,74,12,49,18]}},i.basics=function(e,s,o,a){e=o||e||300,s=a||s||550,e=e.toString(),s=s.toString(),i.attachTo=i.attachTo||"body";var n=t(i.attachTo).css("height"),r=t(i.attachTo).css("width");return e="%"===e.substring(e.length-1)?n:e,s="%"===s.substring(s.length-1)?r:s,{Gheight:parseFloat(e),Gwidth:parseFloat(s),xDist:60,yDist:30,scale:10,xOffset:25,yOffset:20,yStart:0,mainOffset:35,padding:10,xOfPoints:[],yOfPoints:[],mxOfPoints:[],myOfPoints:[],multipleDataSets:!1,legend:!1,interactive:!0,animations:!1,animationDuration:1,pointAnimation:!0,lineAnimation:!0,barAnimation:!0,pieAnimation:!0,grid:!0,xGrid:!0,yGrid:!0,xName:null,yName:null,special:null,showPoints:!0,noLines:!1,pointRadius:5,averagePointRadius:5,pieSize:200,tooltipWidth:50,pieLegend:!0,rx:10,before:"",after:"",title:"",id:"SVGGraph"+i.count}},i.parseS=function(t,i){return'svg[id="'+t+'"] '+i},i.id2selector=function(t){var i=t.split(" ");t=i[0];var e='svg[id="';if("#"!==t.charAt(0))return t;e+=t.substring(1)+'"]';for(var s=1,o=i.length;o>s;++s)e+=" "+i[s];return e},i.design=function(t){t.byCSS=t.byCSS||{},t.design=t.design||{};var i="bar"===t.type?"start":"middle",e=t.height||"100%",s=t.width||"100%",o=t.design,a={};a.style={},a.style[this.parseS(t.id,"")]={height:e,width:s},a.style[this.parseS(t.id,".grid")]={stroke:o.gridColor||"#000","stroke-width":o.gridWidth||"1"},a.style[this.parseS(t.id,".points")]={cursor:"pointer"},a.style[this.parseS(t.id,'circle:not(".middle"):not(".pie-tooltip")')]={opacity:.8},a.style[this.parseS(t.id,".inset")]={fill:o.pointColor||"lightblue"},a.style[this.parseS(t.id,".labels")]={fill:o.labelColor||"#000",stroke:o.labelStroke||"none","font-family":o.labelFont||"Arial","font-size":o.labelFontSize||"13px",kerning:o.labelKerning||"2"},a.style[this.parseS(t.id,".lines")]={stroke:o.lineColor||"darkgrey","stroke-width":o.lineWidth||"2"},a.style[this.parseS(t.id,".averageLine")]={stroke:o.averageLineColor||"green","stroke-width":o.lineWidth||"2"},a.style[this.parseS(t.id,".line-of-1")]={stroke:o.lineColor||"green","stroke-width":o.lineWidth||"2"},a.style[this.parseS(t.id,".rect")]={stroke:o.borderColor||"#fff","stroke-width":o.borderWidth||"2",fill:o.barColor||"blue",opacity:.8},a.style[this.parseS(t.id,".bar")]={stroke:o.barBorder||"#fff",opacity:.8},a.style[this.parseS(t.id,".SVG-tooltip")]={fill:o.tooltipColor||"#000","font-family":o.tooltipFont||"Arial","font-size":o.tooltipFontSize||"13px",display:"none",opacity:"1"},a.style[this.parseS(t.id,".SVG-tooltip-box")]={display:"none",fill:o.tooltipBoxColor||"none",stroke:o.borderColor||"none","stroke-width":o.borderWidth||"2"},a.style[this.parseS(t.id,".area")]={stroke:t.multipleDataSets?"none":o.lineColor||"green","stroke-width":o.borderWidth||"2",fill:o.areaColor||"none",opacity:.8},a.style[this.parseS(t.id,".middle")]={fill:o.donutCenterColor||"#fff"},a.style[this.parseS(t.id,".slice")]={stroke:o.borderColor||"grey","stroke-width":o.borderWidth||"2",opacity:"0.8"},a.style[this.parseS(t.id,".labels.x-labels")]={"text-anchor":o.xLabelAnchor||i},a.style[this.parseS(t.id,".labels.y-labels")]={"text-anchor":o.yLabelAnchor||"end"},a.style['table[id="'+t.id+'"]']={height:e,width:s,"border-collapse":"collapse","text-align":"center"};var n=t.colors||["red","blue","green","orange","purple","yellow","brown","gold","black","grey"];n.push("");for(var r=0,l=n.length;l>r;++r)a.style[this.parseS(t.id,".line-of-"+r)]={stroke:o.lineColor||n[r],"stroke-width":o.lineWidth||"2"},a.style[this.parseS(t.id,".path-of-"+r)]={fill:n[r],opacity:.8},a.style[this.parseS(t.id,".rect-of-"+r)]={fill:n[r]},a.style[this.parseS(t.id,".point-of-"+r)]={fill:n[r]};for(var p in t.byCSS)a.style[this.id2selector(p)]=t.byCSS[p];return a},i.setOptions=function(e){e=e||{},e.points&&t.isArray(e.points[0])&&(e.multipleDataSets=!0),e.attachTo&&(e.attachTo="#"===e.attachTo.charAt(0)?e.attachTo:"#"+e.attachTo,i.attachTo=e.attachTo),e.id&&(e.id="#"===e.id.charAt(0)?e.id.substring(1):e.id),(e.basic===!0||"undefined"==typeof e.basic)&&(this.obj=i.basics(e.height,e.width,e.graphHeight,e.graphWidth)),e&&e.example===!0||!t.isEmptyObject(e)?(e.id=e.id||this.obj.id,t.extend(this.obj,i.defaults(),e,i.design(e)),this.obj.addStyle=!0):e&&e.addStyle===!0?t.extend(this.obj,i.design(e),e):e&&(this.obj=e),this.obj.numPoints=this.obj.points.length,this.obj.xLength=this.obj.x.length},e.prototype.getData=function(){return JSON.stringify(this.obj)},e.prototype.genToFunc=function(t){return t="area"===t?"linear":"combo"===t?"bar":"donut"===t?"pie":t,"Graph"+t.charAt(0).toUpperCase()+t.substring(1)},e.prototype.expand=function(t,i){t="string"==typeof t?jQuery.parseJSON(t):t;var e=new(window[this.genToFunc(this.obj.type)])(t);i=i||"",e.init(i)},e.prototype.update=function(t){t=t||{},t.byCSS=this.obj.byCSS,this.expand(t,"update")},e.prototype.to=function(t,i){var e=i||this.obj;this.obj.type=t,e.type=t,this.expand(e,"update")},e.prototype.createGrid=function(t,i){var e=this.obj,s="",o="",a=e.yDist-30;if(e.grid&&!e.noLines){var n,r=e.height-i*e.yDist;if(e.xGrid)for(var l=0;t>l;++l)n=l*e.xDist+e.mainOffset,s+='';var p=(t-1)*e.xDist+e.mainOffset;if(e.yGrid)for(var l=1;i>=l;++l)n=e.height-l*e.yDist,o+=''}else e.noLines===!1&&(s+='',o+='');return{xGrid:s,yGrid:o}},e.prototype.applyStyling=function(){var i=this.obj;if(i.addStyle)for(var e in i.style)t(e).css(i.style[e])},e.prototype.openTags=function(){return{SVG:'',xGrid:'',yGrid:'',xLabels:'',yLabels:'',title:''}},e.prototype.addLabels=function(){for(var t=this.obj,i="",e="",s=0,o=t.xLength;o>s;++s)i+=''+t.x[s]+"";for(var s=1,o=t.y+1;o>=s;++s){var a=s*t.scale-t.scale+t.yStart,n=a>=10?t.xOffset:t.xOffset-10;e+=''+a+""}return{xLabels:i,yLabels:e}},e.prototype.addTitle=function(t){var i=this.obj;return''+i.title+""},e.prototype.finishGraph=function(t,i,e,s){var o=this.obj;"pie"!==o.type&&(e.xGrid+=this.createGrid(t,i).xGrid,e.yGrid+=this.createGrid(t,i).yGrid,e.xLabels+=this.addLabels().xLabels,e.yLabels+=this.addLabels().yLabels),e.title+=this.addTitle(i),(o.legend&&o.pieLegend||"pie"===o.type)&&(e.legend=this.addLegend(s)),e.points=e.points||"";for(var a in e)e[a]!==e.points&&e[a]!==e.tooltips&&"SVG"!==a&&(e.SVG+=e[a]+"");e.SVG+=e.points+e.tooltips+"";var n=o.before+e.SVG+o.after;return this.handleAppend(s,n),this.applyStyling(),e.SVG},e.prototype.handleAppend=function(i,e){"update"===i?t("#"+this.obj.id).replaceWith(e):t(this.obj.attachTo).append(e)},e.prototype.addLegend=function(){var i=this.obj,e=function(i){var e="add"===i?1:.8,s=t(this).attr("class").substring(7),o='[class*="'+s+'"][id^="'+t(this).attr("id").split("-")[1]+'"]';t("line"+o+", rect"+o+", path"+o).each(function(){t(this).css("opacity",e)})};i.interactive&&i.multipleDataSets&&(t(document).on("mouseover",'g[id^="legend-"]',function(){e.call(this,"add")}),t(document).on("mouseout",'g[id^="legend-"]',function(){e.call(this,"take")}));var s='',o=i.legendX||i.Gwidth-i.xDist,a=30,n=30,r=i.yOffset;if(i.dataNames=i.dataNames||[],i.multipleDataSets||"pie"===i.type)for(var l=0,p=i.numPoints;p>l;++l)s+='',s+='',s+=''+(i.dataNames[l]||"Data"+(0===l?"":" "+l))+"",r+=i.yDist+i.padding;else for(var l=0,p=i.xLength;p>l;++l)s+='',s+=''+(i.x[l]+" : "+i.points[l])+"",r+=i.yDist+i.padding;return"combo"===i.special&&(s+='',s+='',s+='Average'),s+=""},e}(jQuery),GraphLinear=GraphLinear||function(t){var i=function(i){i=i||{},i.type="linear",Graph.call(this,i);var e=function(e){var s=t(this).attr("id"),o=s.split("-"),a=o[0],n=o[1],r=this;t('svg line[id^="'+a+'"], svg path[id^="'+a+'"]').each(function(){if(t(this).attr("id").split("-")[1]===n){var s="#"+t(r).attr("class").split(" ")[0]+"-tooltip",o="#"+t(r).attr("class").split(" ")[0]+"-tooltip-rect";"add"===e?(t(this).css("stroke-width",i.lineWidth||3),t(this).css("opacity",1),t(s).show(),t(o).show()):(t(this).css("stroke-width",i.lineWidth-1||2),t(this).css("opacity",.8),t(s).hide(),t(o).hide())}})};if(this.obj.interactive){var s=this;t(document).on("mouseover",'svg circle[id$="point"]',function(){e.call(this,"add"),t(this).css("opacity",1)}),t(document).on("mouseleave",'svg circle[id$="point"]',function(){e.call(this,"sub"),t(this).css("opacity",s.obj.style['svg[id="'+s.obj.id+'"] circle'].opacity||.8)})}};return i.prototype=Object.create(Graph.prototype),i.prototype.constructor=i,i.prototype.buildPoints=function(t,i){var e,s,o,a,n,r,l,p,d=i?this.obj.averagePointRadius:this.obj.pointRadius,h=this.obj,c=i||h.points;return 1===t.length?(o=c[t[0]],a=t[0],p=t[0],r=!1):2===t.length&&(o=c[t[0]][t[1]],a=""+t[0]+t[1],p=t[1],r=!0),e=h.height-(o+h.scale)*(h.yDist/h.scale),s=p*h.xDist+h.mainOffset,i&&(s+=h.xDist/(h.points.length+1)),l=r===!1?0:t[0],n='',!h.animations||!h.pointAnimation||h.multipleDataSets&&"area"===h.special||(n+=''),n+="",n+='',n+=''+o+""},i.prototype.animateLines=function(){for(var i,e=this.obj,s=t("path[id^="+e.id+"]"),o=0,a=t("path[id^="+e.id+"]").length;a>o;++o)i=s[o].getTotalLength(),s[o].style.transition=s[o].style.WebkitTransition="none",s[o].style.strokeDasharray=i+" "+i,s[o].style.strokeDashoffset=i,s[o].getBoundingClientRect(),s[o].style.transition=s[o].style.WebkitTransition="stroke-dashoffset 2s ease-in-out",s[o].style.strokeDashoffset="0"},i.prototype.init=function(t){var i=this.obj;i.width=i.Gwidth,i.height=i.Gheight;var e=this.openTags();s||(e.lines=''),e.points='';var s="area"===i.special;s&&!i.multipleDataSets&&(e.path='';for(var d=0,h=i.numPoints;h>d;++d){for(var f=0,y=i.points[d].length;y>f;++f)o=i.height-(i.points[d][f]+i.scale)*(i.yDist/i.scale),a=f*i.xDist+i.mainOffset,i.showPoints===!0&&(e.points+=this.buildPoints([d,f])),i.mxOfPoints[d].push(a),i.myOfPoints[d].push(o);if(s){for(var f=0,y=i.points[d].length-1;y>f;++f)n=f+1,e.lines+='';c.push('f;++f)c[d]+="L"+i.mxOfPoints[d][f]+","+i.myOfPoints[d][f]+" ";c[d]+="L"+i.mxOfPoints[d][i.mxOfPoints[d].length-1]+","+p+'">'}else{c.push('f;++f)c[d]+="L"+i.mxOfPoints[d][f]+","+i.myOfPoints[d][f];c[d]+='">'}}e.path+=c.join("")}else{for(var d=0;r>d;++d)o=i.height-(i.points[d]+i.scale)*(i.yDist/i.scale),a=d*i.xDist+i.mainOffset,i.showPoints===!0&&(e.points+=this.buildPoints([d])),i.xOfPoints.push(a),i.yOfPoints.push(o);if(s){e.path+="M"+i.xOfPoints[0]+","+p+" ",e.path+="L"+i.xOfPoints[0]+","+i.yOfPoints[0]+" ";for(var d=1;d'}else for(var d=0,h=i.numPoints-1;h>d;++d){e.lines+=''}}this.finishGraph(r,l,e,t),i.multipleDataSets&&s||!i.animations||!i.lineAnimation||this.animateLines()},i}(jQuery),GraphBar=GraphBar||function(t){var i={},e=function(i){if(i=i||{},i.type="bar",Graph.call(this,i),this.obj.interactive){var e=this;t(document).on("mouseover","svg rect",function(){t("#"+t(this).attr("id")+"-tooltip").show(),t("#"+t(this).attr("id")+"-tooltip-rect").show(),t(this).css("opacity",1)}),t(document).on("mouseleave","svg rect",function(){t("#"+t(this).attr("id")+"-tooltip").hide(),t("#"+t(this).attr("id")+"-tooltip-rect").hide(),t(this).css("opacity",e.obj.style['svg[id="'+e.obj.id+'"] .rect'].opacity||.8)})}};return e.prototype=Object.create(Graph.prototype),e.prototype.constructor=e,i.getAveragePoints=function(t){for(var i,e=[],s=0,o=0,a=t[0].length;a>o;++o){i=0;for(var n=0,r=t.length;r>n;++n)i+=t[n][s];e.push(i/r),++s}return e},e.prototype.init=function(t){var e=this.obj;e.width=e.Gwidth,e.height=e.Gheight;var s=e.x.length+1,o=e.y+1,a=this.openTags();a.rects='',a.tooltips="";var n,r,l,p;if(p=e.yDist-30,e.multipleDataSets){for(var d=[],h=0,c=e.points[0].length;c>h;++h)d.push(0);e.points.push(d);var f,y,g=e.points.length,u=e.points[0].length,b=g-1,x=e.xDist/g,m=function(t){for(var i=0,s=0;u>s;++s){for(var o=0,d=g;d>o;++o)o!==b&&(f=o+i+s*b,y=o+i+2*s,n=0!==e.points[o][i]?(e.points[o][i]+e.scale)*(e.yDist/e.scale)-e.yDist:2,r=f*x+e.mainOffset,l=e.height-e.padding-e.yOffset-n,0===t?a.rects+='':"/>"):1===t&&(a.tooltips+='',a.tooltips+=''+e.points[o][i]+""));e.xOfPoints.lengthh;++h)n=e.height-(v[h]+e.scale)*(e.yDist/e.scale),r=h*e.xDist+e.mainOffset,e.showPoints===!0&&(a.points+=S.buildPoints([h],v)),e.yOfPoints.push(n);for(var h=0,c=v.length-1;c>h;++h){a.lines+=''}}}else{for(var h=0,c=s-1;c>h;++h)n=0!==e.points[h]?(e.points[h]+e.scale)*(e.yDist/e.scale)-e.yDist:2,r=h*e.xDist+e.mainOffset,a.rects+='':"/>");for(var h=0,c=s-1;c>h;++h)n=0!==e.points[h]?(e.points[h]+e.scale)*(e.yDist/e.scale)-e.yDist:2,r=h*e.xDist+e.mainOffset,l=e.height-e.padding-e.yOffset-n,a.tooltips+='',a.tooltips+=''+e.points[h]+""}this.finishGraph(s,o,a,t),"combo"===e.special&&e.multipleDataSets&&e.animations&&S.animateLines()},e}(jQuery),GraphTable=GraphTable||function(){var t=function(t){t=t||{},t.type="table",Graph.call(this,t)};return t.prototype=Object.create(Graph.prototype),t.prototype.constructor=t,t.prototype.init=function(t){var i=this.obj,e=""+(i.dataNames?i.dataNames[0]:"Data")+"",s="";if(i.multipleDataSets)for(var o,a=0,n=i.xLength;n>a;++a){a"+i.dataNames[a+1]+""),o="";for(var r=0,l=i.numPoints;l>r;++r)o+=""+i.points[r][a]+"";s+=""+a+""+i.x[a]+""+o+""}else for(var a=0,n=i.xLength;n>a;++a)s+=""+a+""+i.x[a]+""+i.points[a]+"";var p='"+e+"";p+=s+"",this.handleAppend(t,p),this.applyStyling()},t}(),GraphPie=GraphPie||function(t){var i={},e=function(i){if(i=i||{},i.type="pie",Graph.call(this,i),this.obj.interactive){var e=this.obj;t(document).on("mouseover",'svg path[id^="'+e.id+'"].slice',function(){t("#"+e.id+" .SVG-tooltip").hide(),t("#"+e.id+" .SVG-tooltip-title").hide(),t("#"+t(this).attr("id")+"-tooltip").show(),t("#"+t(this).attr("id")+"-tooltip-title").show(),t('svg path[id^="'+e.id+'"].slice').css("opacity",.8),t('svg path[id^="'+e.id+'"].slice').css("stroke",self.borderColor||"grey"),t(this).css("opacity",1),t(this).css("stroke","#000")}),t(document).on("mouseleave",'svg path[id^="'+e.id+'"].slice',function(){})}};return e.prototype=Object.create(Graph.prototype),e.prototype.constructor=e,i.lineTo=function(t,i){return"L"+t+","+i},i.percent=function(t){return Math.round(100*t)+"%"},e.prototype.init=function(e){if(!this.obj.multipleDataSets){var s=this.obj,o=this.openTags();o.pie='';var a,n,r,l,p,d,h=0,c=s.pieSize||200,f=c-20,y="M"+c+","+c,g="A"+f+","+f,u="0 0,1",b=20,x=i.lineTo(b,c),m=0;s.dataNames=s.x.slice(0);for(var v=0,S=s.numPoints;S>v;++v)h+=s.points[v];for(var v=0,S=s.numPoints;S>v;++v)0!==v&&(x=i.lineTo(a,n)),m+=s.points[v]/h,r=2*m*Math.PI,l=Math.sin(r),p=Math.cos(r),a=c-f*p,n=c-f*l,0===v&&(d=y+x+g+" "+u+a+","+n),o.pie+='',o.pie+="";o.tooltips+='';for(var O=c-c/4,D="",v=0;S>v;++v)D=s.points[v]+" ("+i.percent(s.points[v]/h)+")",o.tooltips+=''+D+")",o.tooltips+='";if("donut"===s.special&&(o.middle=''),s.dataNames)for(var v=0,S=s.dataNames.length;S>v;++v)s.dataNames[v]+=" : "+s.points[v]+" ("+i.percent(s.points[v]/h)+")";this.finishGraph(0,0,o,e),t('svg path[id^="'+s.id+'"].slice').eq(2).mouseover()}},e}(jQuery);!function(t){t.fn.graphify=t.fn.graphify||function(i){i=i||{};var e,s,o,a=t.extend({height:this.css("height"),width:this.css("width"),start:"linear",pos:"top",obj:{}},i),n=a.obj,r=n.id,l=new Graph(0),p={};e=t.isArray(n.points[0])?["linear","area","bar","combo","table"]:["linear","area","bar","pie","donut","table"];var d=this.attr("id")+"-wrapper";this.append('
'),n.attachTo=d+"-g-area";var h=function(){for(var t="",i=0,s=e.length;s>i;++i)t+=' ";return t}();"top"===a.pos&&t("#"+d).prepend(h+"

");var c=a.start;"area"!==c&&"combo"!==c&&"donut"!==c?s=new(window[l.genToFunc(c)])(n):(n.special=c,s=new(window[l.genToFunc(c)])(n)),s.init(),"bottom"===a.pos&&this.append(h),t(document).on("click",'button[id^="'+r+'-graphify-button-"]',function(){var i=t(this).attr("id").split("-")[3];if(p.hasOwnProperty(i)&&!n.animations)t("#"+d+"-g-area").html(p[i]);else{if("area"!==i&&"combo"!==i&&"donut"!==i)n.special=!1,s.to(i,n);else switch(n.special=i,i){case"area":s.to("linear",n);break;case"combo":s.to("bar",n);break;case"donut":s.to("pie",n)}o=new XMLSerializer,p[i]=o.serializeToString(document.getElementById(n.id))}n.type=i})}}(jQuery);
#'+(i.xName||"X")+"