-
Notifications
You must be signed in to change notification settings - Fork 0
/
FusionCharts.jqueryplugin.js
executable file
·15 lines (14 loc) · 3.57 KB
/
FusionCharts.jqueryplugin.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
/*
FusionCharts JavaScript Library jQuery Plugin
Copyright FusionCharts Technologies LLP
License Information at <http://www.fusioncharts.com/license>
@author FusionCharts Technologies LLP
@version fusioncharts/3.2.3-sr1.5347
*/
(function(){var i=FusionCharts(["private","extensions.jQueryPlugin"]);if(i!==void 0){var b=window.jQuery,g,j,k;b.FusionCharts=i.core;g=function(a,d){var c,l,f,h;l=d instanceof Array||d instanceof b?Math.min(a.length,d.length):a.length;for(c=0;c<l;c+=1)if(f=d instanceof Array||d instanceof b?d[c]:d,a[c].parentNode)i.core.render(b.extend({},f,{renderAt:a[c]}));else{f=new FusionCharts(b.extend({},f,{renderAt:a[c]}));if(!b.FusionCharts.delayedRender)b.FusionCharts.delayedRender={};b.FusionCharts.delayedRender[f.id]=
a[c];h=document.createElement("script");h.setAttribute("type","text/javascript");h.appendChild(document.createTextNode("FusionCharts.items['"+f.id+"'].render();"));a[c].appendChild(h)}return a};i.addEventListener("*",function(a,d){var c;b.extend(a,b.Event("fusioncharts"+a.eventType));a.sender&&a.sender.options&&a.sender.options.containerElementId?(c=a.sender.options.containerElementId,typeof c==="object"?b(c).trigger(a,d):b("#"+c).length?b("#"+c).trigger(a,d):b(document).trigger(a,d)):b(document).trigger(a,
d)});j=function(a){return a.filter(":FusionCharts").add(a.find(":FusionCharts"))};k=function(a,d,c){typeof d==="object"&&a.each(function(){this.configureLink(d,c)})};b.fn.insertFusionCharts=function(a){return g(this,a)};b.fn.appendFusionCharts=function(a){a.insertMode="append";return g(this,a)};b.fn.prependFusionCharts=function(a){a.insertMode="prepend";return g(this,a)};b.fn.attrFusionCharts=function(a,d){var c=[],b=j(this);if(d!==void 0)return b.each(function(){this.FusionCharts.setChartAttribute(a,
d)}),this;if(typeof a==="object")return b.each(function(){this.FusionCharts.setChartAttribute(a)}),this;b.each(function(){c.push(this.FusionCharts.getChartAttribute(a))});return c};b.fn.updateFusionCharts=function(a){var d,c,b,f,h,e={},i=j(this),g=[["swfUrl",!1],["height",!1],["width",!1],["bgColor",!0],["renderer",!0],["dataFormat",!1],["dataSource",!1],["detectFlashVersion",!0],["autoInstallRedirect",!0],["lang",!0],["scaleMode",!0],["debugMode",!0]];d=0;for(c=g.length;d<c;d+=1)h=g[d][0],a[h]&&
(g[d][1]&&(f=!0),e[h]=a[h]);i.each(function(){b=this.FusionCharts;if(f)b.clone(e).render();else{if(e.dataSource!==void 0||e.dataFormat!==void 0)e.dataSource===void 0?b.setChartData(b.args.dataSource,e.dataFormat):e.dataFormat===void 0?b.setChartData(e.dataSource,b.args.dataFormat):b.setChartData(e.dataSource,e.dataFormat);(e.width!==void 0||e.height!==void 0)&&b.resizeTo(e.width,e.height);if(e.swfUrl)b.src=e.swfUrl,b.render()}});return this};b.fn.cloneFusionCharts=function(a,d){var c,g;typeof a!==
"function"&&typeof d==="function"&&(g=a,a=d,d=g);c=[];j(this).each(function(){c.push(this.FusionCharts.clone(d,{},!0))});a.call(b(c),c);return this};b.fn.convertToFusionCharts=function(a,d){var c=[];if(typeof a.dataConfiguration==="undefined")a.dataConfiguration={};b.extend(!0,a.dataConfiguration,d);this.each(function(){c.push(b("<div></div>").insertBefore(this).insertFusionCharts(a).get(0))});return b(c)};b.fn.drillDownFusionChartsTo=function(){var a,b,c,g,f,h=j(this);if(typeof this._fcDrillDownLevel===
"undefined")this._fcDrillDownLevel=0;a=0;for(b=arguments.length;a<b;a+=1)if(f=arguments[a],f instanceof Array){c=0;for(g=f.length;c<g;c+=1)k(h,f[c],this._fcDrillDownLevel),this._fcDrillDownLevel+=1}else k(h,f,this._fcDrillDownLevel),this._fcDrillDownLevel+=1;return this};b.extend(b.expr[":"],{FusionCharts:function(a){return a.FusionCharts instanceof i.core}})}})();