/**
* Copyright (c) 2009 - 2010 Chris Leonello
* jqPlot is currently available for use in all personal or commercial projects
* under both the MIT (http://www.opensource.org/licenses/mit-license.php) and GPL
* version 2.0 (http://www.gnu.org/licenses/gpl-2.0.html) licenses. This means that you can
* choose the license that best suits your project and use it accordingly.
*
* Although not required, the author would appreciate an email letting him
* know of any substantial use of jqPlot. You can reach the author at:
* chris at jqplot or see http://www.jqplot.com/info.php .
*
* If you are feeling kind and generous, consider supporting the project by
* making a donation at: http://www.jqplot.com/donate.php .
*
* jqPlot includes date instance methods and printf/sprintf functions by other authors:
*
* Date instance methods contained in jqplot.dateMethods.js:
*
* author Ken Snyder (ken d snyder at gmail dot com)
* date 2008-09-10
* version 2.0.2 (http://kendsnyder.com/sandbox/date/)
* license Creative Commons Attribution License 3.0 (http://creativecommons.org/licenses/by/3.0/)
*
* JavaScript printf/sprintf functions contained in jqplot.sprintf.js:
*
* version 2007.04.27
* author Ash Searle
* http://hexmen.com/blog/2007/03/printf-sprintf/
* http://hexmen.com/js/sprintf.js
* The author (Ash Searle) has placed this code in the public domain:
* "This code is unrestricted: you are free to use it however you like."
*
*/
(function(e){e.jqplot.FunnelRenderer=function(){e.jqplot.LineRenderer.call(this)};e.jqplot.FunnelRenderer.prototype=new e.jqplot.LineRenderer();e.jqplot.FunnelRenderer.prototype.constructor=e.jqplot.FunnelRenderer;e.jqplot.FunnelRenderer.prototype.init=function(q,u){this.padding={top:20,right:20,bottom:20,left:20};this.sectionMargin=6;this.fill=true;this.shadowOffset=2;this.shadowAlpha=0.07;this.shadowDepth=5;this.highlightMouseOver=true;this.highlightMouseDown=false;this.highlightColors=[];this.widthRatio=0.2;this.lineWidth=2;this.dataLabels="percent";this.showDataLabels=false;this.dataLabelFormatString=null;this.dataLabelThreshold=3;this.tickRenderer=e.jqplot.FunnelTickRenderer;if(q.highlightMouseDown&&q.highlightMouseOver==null){q.highlightMouseOver=false}e.extend(true,this,q);this._highlightedPoint=null;this._bases=[];this._atot;this._areas=[];this._lengths=[];this._angle;this._dataIndices=[];this._unorderedData=e.extend(true,[],this.data);var p=e.extend(true,[],this.data);for(var s=0;s
570)?n[o]*0.8:n[o]+0.4*(255-n[o]);n[o]=parseInt(n[o],10)}this.highlightColors.push("rgb("+n[0]+","+n[1]+","+n[2]+")")}}u.postParseOptionsHooks.addOnce(l);u.postInitHooks.addOnce(g);u.eventListenerHooks.addOnce("jqplotMouseMove",a);u.eventListenerHooks.addOnce("jqplotMouseDown",b);u.eventListenerHooks.addOnce("jqplotMouseUp",k);u.eventListenerHooks.addOnce("jqplotClick",f);u.eventListenerHooks.addOnce("jqplotRightClick",m);u.postDrawHooks.addOnce(h)};e.jqplot.FunnelRenderer.prototype.setGridData=function(p){var o=0;var q=[];for(var n=0;nthis._lengths[Z]*o&&X<100){this._lengths[Z]=this._areas[Z]/(this._bases[Z]-this._lengths[Z]*Math.tan(this._angle));ab=Math.abs(this._lengths[Z]-F);this._bases[Z+1]=this._bases[Z]-(2*this._lengths[Z]*Math.tan(this._angle));F=this._lengths[Z];X++}R+=this._lengths[Z]}this._vertices=new Array(C.length);var af=[u,G],ae=[u+this._bases[0],G],ad=[u+(this._bases[0]-this._bases[this._bases.length-1])/2,G+this._length],ac=[ad[0]+this._bases[this._bases.length-1],ad[1]];function W(ah){var x=(af[1]-ad[1])/(af[0]-ad[0]);var v=af[1]-x*af[0];var ai=ah+af[1];return[(ai-v)/x,ai]}function E(ah){var x=(ae[1]-ac[1])/(ae[0]-ac[0]);var v=ae[1]-x*ae[0];var ai=ah+ae[1];return[(ai-v)/x,ai]}var U=z,T=w;var aa=0,n=0;for(Z=0;Z0&&Z0&&Z=this.dataLabelThreshold){var L,Y;if(this.dataLabels=="label"){L=this.dataLabelFormatString||"%s";Y=e.jqplot.sprintf(L,C[Z][0])}else{if(this.dataLabels=="value"){L=this.dataLabelFormatString||"%d";Y=e.jqplot.sprintf(L,this.data[Z][1])}else{if(this.dataLabels=="percent"){L=this.dataLabelFormatString||"%d%%";Y=e.jqplot.sprintf(L,C[Z][1]*100)}else{if(this.dataLabels.constructor==Array){L=this.dataLabelFormatString||"%s";Y=e.jqplot.sprintf(L,this.dataLabels[this._dataIndices[Z]])}}}}var t=(this._radius)*this.dataLabelPositionFactor+this.sliceMargin+this.dataLabelNudge;var U=(V[0][0]+V[1][0])/2+this.canvas._offsets.left;var T=(V[1][1]+V[2][1])/2+this.canvas._offsets.top;var A=e(''+Y+"").insertBefore(q.eventCanvas._elem);U-=A.width()/2;T-=A.height()/2;U=Math.round(U);T=Math.round(T);A.css({left:U,top:T})}}};e.jqplot.FunnelAxisRenderer=function(){e.jqplot.LinearAxisRenderer.call(this)};e.jqplot.FunnelAxisRenderer.prototype=new e.jqplot.LinearAxisRenderer();e.jqplot.FunnelAxisRenderer.prototype.constructor=e.jqplot.FunnelAxisRenderer;e.jqplot.FunnelAxisRenderer.prototype.init=function(n){this.tickRenderer=e.jqplot.FunnelTickRenderer;e.extend(true,this,n);this._dataBounds={min:0,max:100};this.min=0;this.max=100;this.showTicks=false;this.ticks=[];this.showMark=false;this.show=false};e.jqplot.FunnelLegendRenderer=function(){e.jqplot.TableLegendRenderer.call(this)};e.jqplot.FunnelLegendRenderer.prototype=new e.jqplot.TableLegendRenderer();e.jqplot.FunnelLegendRenderer.prototype.constructor=e.jqplot.FunnelLegendRenderer;e.jqplot.FunnelLegendRenderer.prototype.init=function(n){this.numberRows=null;this.numberColumns=null;e.extend(true,this,n)};e.jqplot.FunnelLegendRenderer.prototype.draw=function(){var q=this;if(this.show){var y=this._series;var B="position:absolute;";B+=(this.background)?"background:"+this.background+";":"";B+=(this.border)?"border:"+this.border+";":"";B+=(this.fontSize)?"font-size:"+this.fontSize+";":"";B+=(this.fontFamily)?"font-family:"+this.fontFamily+";":"";B+=(this.textColor)?"color:"+this.textColor+";":"";B+=(this.marginTop!=null)?"margin-top:"+this.marginTop+";":"";B+=(this.marginBottom!=null)?"margin-bottom:"+this.marginBottom+";":"";B+=(this.marginLeft!=null)?"margin-left:"+this.marginLeft+";":"";B+=(this.marginRight!=null)?"margin-right:"+this.marginRight+";":"";this._elem=e('');var F=false,x=false,n,v;var z=y[0];var o=new e.jqplot.ColorGenerator(z.seriesColors);if(z.show){var G=z.data;if(this.numberRows){n=this.numberRows;if(!this.numberColumns){v=Math.ceil(G.length/n)}else{v=this.numberColumns}}else{if(this.numberColumns){v=this.numberColumns;n=Math.ceil(G.length/this.numberColumns)}else{n=G.length;v=1}}var E,D,p,t,r,u,w,C;var A=0;for(E=0;E').prependTo(this._elem)}else{p=e('
').appendTo(this._elem)}for(D=0;D0){F=true}else{F=false}}else{if(E==n-1){F=false}else{F=true}}w=(F)?this.rowSpacing:"0";t=e(' | ');r=e(' | ');if(this.escapeHtml){r.text(u)}else{r.html(u)}if(x){r.prependTo(p);t.prependTo(p)}else{t.appendTo(p);r.appendTo(p)}F=true}A++}}}}return this._elem};function c(r,q,o){o=o||{};o.axesDefaults=o.axesDefaults||{};o.legend=o.legend||{};o.seriesDefaults=o.seriesDefaults||{};var n=false;if(o.seriesDefaults.renderer==e.jqplot.FunnelRenderer){n=true}else{if(o.series){for(var p=0;p