8 lines
No EOL
1.4 KiB
JavaScript
8 lines
No EOL
1.4 KiB
JavaScript
/* http://keith-wood.name/gChart.html
|
|
Google Chart GraphViz extension for jQuery v1.4.3.
|
|
See API details at http://code.google.com/apis/chart/.
|
|
Written by Keith Wood (kbwood{at}iinet.com.au) September 2008.
|
|
Dual licensed under the GPL (http://dev.jquery.com/browser/trunk/jquery/GPL-LICENSE.txt) and
|
|
MIT (http://dev.jquery.com/browser/trunk/jquery/MIT-LICENSE.txt) licenses.
|
|
Please attribute the author if you use it. */
|
|
(function($){$.extend($.gchart._chartTypes,{graphviz:'gv',gv:'gv'});$.extend($.gchart._typeOptions,{gv:'no'});$.extend($.gchart._prototype.prototype,{graphviz:function(a,b,c,d,e,f){if(arguments.length==1){d=a;a='dot'}var g=typeof a=='string';if(!g){f=e;e=d;d=c;c=b;b=a;a='dot'}if((b&&typeof b!='object')||arguments.length==2||(arguments.length==3&&g)){f=e;e=d;d=c;c=b;b={}}if(typeof c!='boolean'&&arguments.length>1){f=e;e=d;d=c;c=false}b=b||{};b.type='gv'+(a!='dot'?':'+a:'');b.dataLabels=[typeof d=='string'?d:this._genGraph(c,d,e,f)];return b},_genGraph:function(a,b,c,d){d=d||{};var e=(a?'digraph':'graph')+'{';var f='';for(var n in d){e+=f+n;var g='[';for(var h in d[n]){e+=g+h+'='+d[n][h];g=','}e+=(g!='['?']':'');f=';'}for(var i in b||{}){e+=f+i;var g='[';for(var n in b[i]){e+=g+n+'='+b[i][n];g=','}e+=(g!='['?']':'');f=';'}for(var j in c||{}){for(var n in c[j]){e+=f+j+(a?'->':'--')+c[j][n]}f=';'}e+='}';return e},noOptions:function(a,b){return'&chl='+b.substr(1)}})})(jQuery); |