text: /*
   * Copyright (c) 2001-2007, TIBCO Software Inc.
   * Use, modification, and distribution subject to terms of license.
   */
  jsx3.require("jsx3.chart.Chart","jsx3.chart.Axis","jsx3.chart.GridLines");jsx3.Class.defineClass("jsx3.chart.CartesianChart",jsx3.chart.Chart,null,function(g,b){var vb=jsx3.chart;var Zb=vb.Chart;var Tb=vb.GridLines;var qb=vb.Axis;g.XPRIMARY_FILTER=function(l){return l instanceof qb&&l.sX()&&l.getHorizontal();};g.XSECONDARY_FILTER=function(c){return c instanceof qb&&!c.sX()&&c.getHorizontal();};g.YPRIMARY_FILTER=function(n){return n instanceof qb&&n.sX()&&!n.getHorizontal();};g.YSECONDARY_FILTER=function(m){return m instanceof qb&&!m.sX()&&!m.getHorizontal();};g.ZINDEX_GRIDLINES=Zb.ZINDEX_DATA+1;g.ZINDEX_GRIDLINES_FOREGROUND=Zb.ZINDEX_DATA+90;g.ZINDEX_AXIS=Zb.ZINDEX_DATA+100;g.PART_GRIDLINES=1<<8;b.init=function(c,j,m,d,k){this.jsxsuper(c,j,m,d,k);};b.getGridLines=function(){return Tb?this.getDescendantsOfType(Tb):[];};b.aX=function(l,r){var Qb=[];var Gc=r?this.aO():this.getSeries();for(var w=0;w<Gc.length;w++){if(l.getHorizontal()&&l.sX()==Gc[w].getUsePrimaryX()||!l.getHorizontal()&&l.sX()==Gc[w].getUsePrimaryY())Qb.push(Gc[w]);}return Qb;};b.getPrimaryXAxis=function(){return this.findDescendants(g.XPRIMARY_FILTER,false,false,true);};b.getSecondaryXAxis=function(){return this.findDescendants(g.XSECONDARY_FILTER,false,false,true);};b.getPrimaryYAxis=function(){return this.findDescendants(g.YPRIMARY_FILTER,false,false,true);};b.getSecondaryYAxis=function(){return this.findDescendants(g.YSECONDARY_FILTER,false,false,true);};b.getRangeForAxis=function(p){var I=this.aX(p,true);return p.getHorizontal()?this.getXRange(I):this.getYRange(I);};b.getXRange=jsx3.Method.newAbstract("series");b.getYRange=jsx3.Method.newAbstract("series");b.getRangeForField=function(c,j){var hb=this.gH();if(hb==null){vb.LOG.debug("no data provider for chart: "+this);return null;}var ob=Number.NEGATIVE_INFINITY;var Q=Number.POSITIVE_INFINITY;for(var S=0;S<hb.length;S++){var jb=hb[S];for(var Y=0;Y<c.length;Y++){var L=c[Y];var Bb=L[j](jb);if(Bb!=null){Q=Math.min(Q,Bb);ob=Math.max(ob,Bb);}}}if(ob==Number.NEGATIVE_INFINITY||Q==Number.POSITIVE_INFINITY)return null;return [Q,ob];};b.getStackedRangeForField=function(m,l){var nc=this.gH();if(nc==null){vb.LOG.debug("no data provider for chart: "+this);return null;}var hc=Number.NEGATIVE_INFINITY;var cb=Number.POSITIVE_INFINITY;for(var Cc=0;Cc<nc.length;Cc++){var ec=nc[Cc];var O=0,Nb=0;for(var R=0;R<m.length;R++){var hb=m[R];var yc=hb[l](ec);if(yc==null)continue;if(yc>=0)O=O+yc;else Nb=Nb+yc;}cb=Math.min(cb,Nb);hc=Math.max(hc,O);}if(hc==Number.NEGATIVE_INFINITY||cb==Number.POSITIVE_INFINITY)return null;return [cb,hc];};b.getStacked100RangeForField=function(p,i){var I=this.gH();if(I==null){vb.LOG.debug("no data provider for chart: "+this);return null;}var C=Number.NEGATIVE_INFINITY;var X=Number.POSITIVE_INFINITY;for(var ac=0;ac<I.length;ac++){var y=I[ac];var ec=0,gb=0,M=0;for(var pc=0;pc<p.length;pc++){var rc=p[pc];var fb=rc[i](y);if(fb==null)continue;M=M+Math.abs(fb);if(fb>=0)ec=ec+fb;else gb=gb+fb;}var kb=M==0?0:100*gb/M;var sc=M==0?0:100*ec/M;X=Math.min(X,kb);C=Math.max(C,sc);}if(C==Number.NEGATIVE_INFINITY||X==Number.POSITIVE_INFINITY)return null;return [X,C];};b.getCombinedRange=function(f){var Wb=Number.NEGATIVE_INFINITY;var E=Number.POSITIVE_INFINITY;for(var mb=0;mb<f.length;mb++){if(f[mb]!=null){E=Math.min(E,f[mb][0]);Wb=Math.max(Wb,f[mb][1]);}}if(Wb==Number.NEGATIVE_INFINITY||E==Number.POSITIVE_INFINITY)return null;return [E,Wb];};b.updateView=function(){this.jsxsuper();var Ab=this.M4();var Ob=this.getPrimaryXAxis();var Cc=this.getPrimaryYAxis();var Dc=this.getSecondaryXAxis();var E=this.getSecondaryYAxis();var Ec=Ab.getWidth();var z=Ab.getHeight();var zc=Ab.getPaddingDimensions();var tb=null;for(var kb=1;kb<=2;kb++){var W=null;if(kb==1){W=[Dc!=null?Dc.getDisplayWidth():0,E!=null?E.getDisplayWidth():0,Ob!=null?Ob.getDisplayWidth():0,Cc!=null?Cc.getDisplayWidth():0];}else{W=this.getAxisMetrics(Dc,E,Ob,Cc);}tb=[zc[3]+W[3],zc[0]+W[0],Ec-(zc[3]+W[3]+zc[1]+W[1]),z-(zc[0]+W[0]+zc[2]+W[2])];this.prepareAxis(Ob,tb[2]);this.prepareAxis(Cc,tb[3]);this.prepareAxis(Dc,tb[2]);this.prepareAxis(E,tb[3]);}var sc=this.getGridLines();for(var kb=0;kb<sc.length;kb++){var Xb=sc[kb];if(Xb.getDisplay()==jsx3.gui.Block.DISPLAYNONE)continue;Xb.setDimensions(tb);Xb.setZIndex(Xb.getInForeground()?g.ZINDEX_GRIDLINES_FOREGROUND:g.ZINDEX_GRIDLINES);Xb.updateView();Ab.appendChild(Xb.l5());}this.updateAxisView(Ob,tb[0],tb[1]);this.updateAxisView(Cc,tb[0],tb[1]);this.updateAxisView(Dc,tb[0],tb[1]);this.updateAxisView(E,tb[0],tb[1]);var Z=this.aO();for(var kb=0;kb<Z.length;kb++){Z[kb].setDimensions(tb);}};b.prepareAxis=function(l,k){if(l!=null){l.setLength(k);l.g6();}};b.updateAxisView=function(i,q,r){var Gb=this.M4();if(i!=null){i.setDimensions(q,r,Gb.getWidth(),Gb.getHeight());i.setZIndex(g.ZINDEX_AXIS);i.updateView();Gb.appendChild(i.l5());}};b.getAxisMetrics=function(q,j,r,f){var Z=0,Ab=0,Nb=0,wc=0;if(q!=null){var lb=q.x1();Ab=lb[1];wc=lb[0];}if(j!=null){var lb=j.x1();Nb=Nb+lb[0];Z=Z+lb[1];}if(r!=null){var lb=r.x1();wc=Math.max(wc,lb[1]);Ab=Math.max(Ab,lb[0]);}if(f!=null){var lb=f.x1();Z=Math.max(Z,lb[0]);Nb=Math.max(Nb,lb[1]);}return [Ab,Nb,wc,Z];};b.repaintParts=function(e){if(e&g.PART_GRIDLINES){var Nb=this.getGridLines();for(var y=0;y<Nb.length;y++){var Z=Nb[y];if(Z.getDisplay()==jsx3.gui.Block.DISPLAYNONE)continue;Z.setZIndex(Z.getInForeground()?g.ZINDEX_GRIDLINES_FOREGROUND:g.ZINDEX_GRIDLINES);Z.repaint();}}this.jsxsuper(e);};b.onSetChild=function(r){if(Tb&&r instanceof Tb){return true;}else{if(qb&&r instanceof qb){return true;}else{return this.jsxsuper(r);}}};b.toString=function(){return "[CartesianChart '"+this.getName()+"']";};g.getVersion=function(){return vb.q2;};});
  