?? chartingbase.js
字號:
this.__layoutComponent();this.layoutAllChildren();};_p.__layoutChildren=function()
{if(!this.getCreated())
return;var y=0;var cs=this.getChildren();for(var i=0;i<cs.length;i++)
{cs[i].setTop(y);y+=cs[i].getPreferredHeight();}};_p.layoutAllChildren=function()
{this.__layoutChildren();BiComponent.prototype.layoutAllChildren.call(this);};_p.layoutAllChildrenY=function()
{this.__layoutChildren();BiComponent.prototype.layoutAllChildrenY.call(this);};_p.getPreferredWidth=function()
{var pw=0;var cs=this.getChildren();for(var i=0;i<cs.length;i++)
{pw=Math.max(pw,cs[i].getPreferredWidth());}
return this.getInsetLeft()+this.getInsetRight()+pw;};_p.getPreferredHeight=function()
{var ph=0;var cs=this.getChildren();for(var i=0;i<cs.length;i++)
{ph+=cs[i].getPreferredHeight();}
return this.getInsetTop()+this.getInsetBottom()+ph;};_p.setFontSize=function(n)
{if(n!=this._fontSize)
{this._fontSize=n;var cs=this.getChildren();for(var i=0;i<cs.length;i++)
cs[i].setStyleProperty("fontSize",n+"px");this.layoutComponent();}};_p.dispose=function(){if(this._disposed)return;BiComponent.prototype.dispose.call(this);this._graph=null;};_p.fromXmlElement=function(oNode){this.setVisible(oNode.getAttribute("Visible")!="false");};_p.toXmlElement=function(oDoc){var el=oDoc.createElement("Legend");el.setAttribute("Visible",String(this.getVisible()));return el;};_p._setTop=function(n){BiComponent.prototype.setTop.call(this,n);};_p.setTop=function(nTop){this._topSet=nTop!=null;BiComponent.prototype.setTop.call(this,nTop);};_p.setLocation=function(nLeft,nTop){this._topSet=nTop!=null;BiComponent.prototype.setLocation.call(this,nLeft,nTop);};function BiChartLegendLabel(oLegendFor){BiLabel.call(this);this._legendFor=oLegendFor;this.setPadding(2);this.setText(oLegendFor.getTitle());this.setIcon(oLegendFor);this.setLeft(0);this.setRight(0);}
var _p=BiChartLegendLabel.prototype=new BiLabel;_p._className="BiChartLegendLabel";_p._legendFor=null;BiChartLegendLabel.prototype.getLegendFor=function(){return this._legendFor;};_p.setLegendFor=function(oLegendFor){this._legendFor=oLegendFor;this.setText(oLegendFor.getTitle());this.setIcon(oLegendFor);};_p.dispose=function(){if(this.getDisposed())return;BiLabel.prototype.dispose.call(this);this._graph=null;this._legendFor=null;};function BiChartPoint(oGraph,sSeriesId,sCategoryId){BiObject.call(this);this._graph=oGraph;this._seriesId=sSeriesId;this._categoryId=sCategoryId;};var _p=BiChartPoint.prototype=new BiObject;_p._className="BiChartPoint";_p._categoryId=null;_p._seriesId=null;_p._fillOpacity=null;_p._fillColor=null;_p._fillColor2=null;_p._fillType=null;_p._fillAngle=null;_p._strokeOpacity=null;_p._strokeColor=null;BiChartPoint.prototype.getCategoryId=function(){return this._categoryId;};BiChartPoint.prototype.getSeriesId=function(){return this._seriesId;};BiChartPoint.prototype.getFillOpacity=function(){return this._fillOpacity;};BiChartPoint.prototype.getFillColor=function(){return this._fillColor;};BiChartPoint.prototype.getFillColor2=function(){return this._fillColor2;};BiChartPoint.prototype.getFillType=function(){return this._fillType;};BiChartPoint.prototype.getFillAngle=function(){return this._fillAngle;};BiChartPoint.prototype.getStrokeOpacity=function(){return this._strokeOpacity;};BiChartPoint.prototype.getStrokeColor=function(){return this._strokeColor;};BiChartPoint.prototype.getMarkerType=function(){return this._markerType;};BiChartPoint.prototype.getMarkerVisible=function(){return this._markerVisible;};BiChartPoint.prototype.getExplode=function(){return this._explode;};_p.hasFillOpacity=function(){return this._fillOpacity!=null;};_p.hasFillColor=function(){return this._fillColor!=null;};_p.hasFillColor2=function(){return this._fillColor2!=null;};_p.hasFillType=function(){return this._fillType!=null;};_p.hasFillAngle=function(){return this._fillAngle!=null;};_p.hasStrokeOpacity=function(){return this._strokeOpacity!=null;};_p.hasStrokeColor=function(){return this._strokeColor!=null;};_p.hasMarkerType=function(){return this._markerType!=null;};_p.hasMarkerVisible=function(){return this._markerVisible!=null;};_p.hasExplode=function(){return this._explode!=null;};_p.getComponent=function(){var s=this._graph.getSeriesById(this._seriesId);var c=this._graph.getChartForSeries(s);if(!c)return null;var cat=this._graph.getCategoryById(this._categoryId);return c.getComponentForCategory(cat);};BiChartPoint.fromXmlElement=function(oGraph,oNode){var p=new BiChartPoint(oGraph);p.fromXmlElement(oNode);return p;};_p.fromXmlElement=function(oNode){var seriesId=oNode.getAttribute("Series");var categoryId=oNode.getAttribute("Category");this._seriesId=seriesId;this._categoryId=categoryId;var n=oNode.selectSingleNode("Stroke/@Opacity");if(n)this.setStrokeOpacity(Number(n.text));n=oNode.selectSingleNode("Stroke/@Color");if(n)this.setStrokeColor(n.text);n=oNode.selectSingleNode("Fill/@Opacity");if(n)this.setFillOpacity(Number(n.text));n=oNode.selectSingleNode("Fill/@Color");if(n)this.setFillColor(n.text);n=oNode.selectSingleNode("Fill/@Color2");if(n)this.setFillColor2(n.text);n=oNode.selectSingleNode("Fill/@Type");if(n)this.setFillType(n.text);n=oNode.selectSingleNode("Fill/@Angle");if(n)this.setFillAngle(n.text);n=oNode.selectSingleNode("Marker/@Type");if(n)this.setMarkerType(n.text);n=oNode.selectSingleNode("Marker/@Visible");if(n)this.setMarkerVisible(n.text!="false");n=oNode.selectSingleNode("Explode");if(n)this.setExplode(Number(n.text));};_p.toXmlElement=function(oDoc){var p=oDoc.createElement("Point");p.setAttribute("Series",this.getSeriesId())
p.setAttribute("Category",this.getCategoryId())
var el;if(this.hasStrokeColor()||this.hasStrokeOpacity()){el=oDoc.createElement("Stroke");if(this.hasStrokeOpacity())
el.setAttribute("Opacity",String(this.getStrokeOpacity()));if(this.hasStrokeColor())
el.setAttribute("Color",this.getStrokeColor());p.appendChild(el);}
if(this.hasFillColor()||this.hasFillColor2()||this.hasFillType()||this.hasFillAngle()||this.hasFillOpacity()){el=oDoc.createElement("Fill");if(this.hasFillOpacity())
el.setAttribute("Opacity",String(this.getFillOpacity()));if(this.hasFillColor())
el.setAttribute("Color",this.getFillColor());if(this.hasFillColor2())
el.setAttribute("Color2",this.getFillColor2());if(this.hasFillType())
el.setAttribute("Type",this.getFillType());if(this.hasFillAngle())
el.setAttribute("Angle",this.getFillAngle());p.appendChild(el);}
if(this.hasMarkerVisible()||this.hasMarkerType()){el=oDoc.createElement("Marker");if(this.hasMarkerVisible())
el.setAttribute("Visible",this.getMarkerVisible());if(this.hasMarkerType())
el.setAttribute("Type",this.getMarkerType());p.appendChild(el);}
if(this.hasExplode()){el=oDoc.createElement("Explode");el.appendChild(oDoc.createTextNode(String(this.getExplode())));p.appendChild(el);}
return p;};_p.dispose=function(){if(this._disposed)return;this._graph=null;};_p._setPropForPoint=function(sFieldName,sSetterName,oArg){this[sFieldName]=oArg;var g=this._graph
var c=g.getComponentByIds(this._seriesId,this._categoryId);if(c)
c[sSetterName](oArg);};_p.setFillOpacity=function(v){this._setPropForPoint("_fillOpacity","setFillOpacity",v);};_p.setFillColor=function(v){this._setPropForPoint("_fillColor","setFillColor",v);};_p.setFillColor2=function(v){this._setPropForPoint("_fillColor2","setFillColor2",v);};_p.setFillType=function(v){this._setPropForPoint("_fillType","setFillType",v);};_p.setFillAngle=function(v){this._setPropForPoint("_fillAngle","setFillAngle",v);};_p.setStrokeOpacity=function(v){this._setPropForPoint("_strokeOpacity","setStrokeOpacity",v);};_p.setStrokeColor=function(v){this._setPropForPoint("_strokeColor","setStrokeColor",v);};_p.setMarkerType=function(v){this._setPropForPoint("_markerType","setMarkerType",v);};_p.setMarkerVisible=function(v){this._setPropForPoint("_markerVisible","setMarkerVisible",v);};_p.setExplode=function(v){this._setPropForPoint("_explode","setExplode",v);};function BiChartPresentation(oGraph,oSeries){BiObject.call(this);this._graph=oGraph;this._series=oSeries;};var _p=BiChartPresentation.prototype=new BiObject;_p._className="BiChartPresentation";_p._fillOpacity=null;_p._fillColor=null;_p._fillColor2=null;_p._fillType=null;_p._fillAngle=null;_p._strokeOpacity=null;_p._strokeColor=null;_p._markerType=null;_p._markerVisible=null;_p._explode=null;_p._barSpacing=null;BiChartPresentation.prototype.getGraph=function(){return this._graph;};BiChartPresentation.prototype.getSeries=function(){return this._series;};BiChartPresentation.prototype.getFillOpacity=function(){return this._fillOpacity;};BiChartPresentation.prototype.setFillOpacity=function(v){this._fillOpacity=v;};BiChartPresentation.prototype.getFillColor=function(){return this._fillColor;};BiChartPresentation.prototype.setFillColor=function(v){this._fillColor=v;};BiChartPresentation.prototype.getFillColor2=function(){return this._fillColor2;};BiChartPresentation.prototype.setFillColor2=function(v){this._fillColor2=v;};BiChartPresentation.prototype.getFillType=function(){return this._fillType;};BiChartPresentation.prototype.setFillType=function(v){this._fillType=v;};BiChartPresentation.prototype.getFillAngle=function(){return this._fillAngle;};BiChartPresentation.prototype.setFillAngle=function(v){this._fillAngle=v;};BiChartPresentation.prototype.getStrokeColor=function(){return this._strokeColor;};BiChartPresentation.prototype.setStrokeColor=function(v){this._strokeColor=v;};BiChartPresentation.prototype.getStrokeOpacity=function(){return this._strokeOpacity;};BiChartPresentation.prototype.setStrokeOpacity=function(v){this._strokeOpacity=v;};BiChartPresentation.prototype.getMarkerType=function(){return this._markerType;};BiChartPresentation.prototype.setMarkerType=function(v){this._markerType=v;};BiChartPresentation.prototype.getMarkerVisible=function(){return this._markerVisible;};BiChartPresentation.prototype.setMarkerVisible=function(v){this._markerVisible=v;};BiChartPresentation.prototype.getExplode=function(){return this._explode;};BiChartPresentation.prototype.setExplode=function(v){this._explode=v;};BiChartPresentation.prototype.getBarSpacing=function(){return this._barSpacing;};_p.hasFillOpacity=function(){return this._fillOpacity!=null;};_p.hasFillColor=function(){return this._fillColor!=null;};_p.hasFillColor2=function(){return this._fillColor2!=null;};_p.hasFillType=function(){return this._fillType!=null;};_p.hasFillAngle=function(){return this._fillAngle!=null;};_p.hasStrokeColor=function(){return this._strokeColor!=null;};_p.hasStrokeOpacity=function(){return this._strokeOpacity!=null;};_p.hasMarkerType=function(){return this._markerType!=null;};_p.hasMarkerVisible=function(){return this._markerVisible!=null;};_p.hasExplode=function(){return this._explode!=null;};_p.hasBarSpacing=function(){return this._barSpacing!=null;};_p.setBarSpacing=function(n)
{this._barSpacing=n;this._graph.getPresentationManager().setBarSpacingForPoint(null,null,n);};BiChartPresentation.fromXmlElement=function(oGraph,oNode){var p=new BiChartPresentation(oGraph);p.fromXmlElement(oNode);if(p._series==null)
return null;return p;};_p.fromXmlElement=function(oNode){var seriesId=oNode.getAttribute("Series");var series=this._graph.getSeriesById(seriesId);if(!series)
return null;this._series=series;var n=oNode.selectSingleNode("Stroke/@Opacity");if(n)this.setStrokeOpacity(Number(n.text));n=oNode.selectSingleNode("Stroke/@Color");if(n)this.setStrokeColor(n.text);n=oNode.selectSingleNode("Fill/@Opacity");if(n)this.setFillOpacity(Number(n.text));n=oNode.selectSingleNode("Fill/@Color");if(n)this.setFillColor(n.text);n=oNode.selectSingleNode("Fill/@Color2");if(n)this.setFillColor2(n.text);n=oNode.selectSingleNode("Fill/@Type");if(n)this.setFillType(n.text);n=oNode.selectSingleNode("Fill/@Angle");if(n)this.setFillAngle(n.text);n=oNode.selectSingleNode("Marker/@Type");if(n)this.setMarkerType(n.text);n=oNode.selectSingleNode("Marker/@Visible");if(n)this.setMarkerVisible(n.text!="false");n=oNode.selectSingleNode("Explode");if(n)this.setExplode(Number(n.text));n=oNode.selectSingleNode("BarSpacing");if(n)this.setBarSpacing(Number(n.text));};_p.toXmlElement=function(oDoc){var c=oDoc.createElement("Chart");c.setAttribute("Series",this.getSeries().getId());var el;if(this.hasStrokeColor()||this.hasStrokeOpacity()){el=oDoc.createElement("Stroke");if(this.hasStrokeOpacity())
el.setAttribute("Opacity",String(this.getStrokeOpacity()));if(this.hasStrokeColor())
el.setAttribute("Color",this.getStrokeColor());c.appendChild(el);}
if(this.hasFillColor()||this.hasFillColor2()||this.hasFillType()||this.hasFillAngle()||this.hasFillOpacity()){el=oDoc.createElement("Fill");if(this.hasFillOpacity())
el.setAttribute("Opacity",String(this.getFillOpacity()));if(this.hasFillColor())
el.setAttribute("Color",this.getFillColor());if(this.hasFillColor2())
el.setAttribute("Color2",this.getFillColor2());if(this.hasFillType())
el.setAttribute("Type",this.getFillType());if(this.hasFillAngle())
el.setAttribute("Angle",this.getFillAngle());c.appendChild(el);}
if(this.hasMarkerVisible()||this.hasMarkerType()){el=oDoc.createElement("Marker");if(this.hasMarkerVisible())
el.setAttribute("Visible",this.getMarkerVisible());if(this.hasMarkerType())
el.setAttribute("Type",this.getMarkerType());c.appendChild(el);}
if(this.hasExplode()){el=oDoc.createElement("Explode");el.appendChild(oDoc.createTextNode(String(this.getExplode())));c.appendChild(el);}
if(this.hasBarSpacing()){el=oDoc.createElement("BarSpacing");el.appendChild(oDoc.createTextNode(String(this.getBarSpacing())));c.appendChild(el);}
return c;};_p.dispose=function(){if(this._disposed)return;this._graph=null;this._series=null;};function BiChartPresentationManager(oGraph){BiObject.call(this);this._graph=oGraph;}
var _p=BiChartPresentationManager.prototype=new BiObject;_p._className="BiChartPresentationManager";_p._barSpacing=null;_p._defaultColors=["Red","Green","Blue","Yellow","Aqua","Fuchsia","Lime","Maroon","Navy","Olive","Purple","Teal"];_p.getDefaultColor=function(sSeriesId,sCategoryId){var i=this._getDefaulSettingIndex(sSeriesId,sCategoryId);if(i>=this._defaultColors.length){return"#"+Math.floor(Math.random()*16).toString(16)+Math.floor(Math.random()*16).toString(16)+Math.floor(Math.random()*16).toString(16);}
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -