basechartbacking.lzx
<library>
<include href="extensions/drawview.lzx"/>
<class name="basechartbacking" width="${parent.width}" height="${parent.height}" bgcolor="0xDEDEDD">
<attribute name="vlinesdrawn" type="boolean" value="false
"/>
<attribute name="vbandsdrawn" type="boolean" value="false
"/>
<attribute name="hlinesdrawn" type="boolean" value="false
"/>
<attribute name="hbandsdrawn" type="boolean" value="false
"/>
<attribute name="belowzerodrawn" type="boolean" value="false
"/>
<attribute name="zerodrawn" type="boolean" value="false
"/>
<attribute name="vticksdrawn" type="boolean" value="false
"/>
<attribute name="hticksdrawn" type="boolean" value="false
"/>
<attribute name="vticklabelsdrawn" type="boolean" value="false
"/>
<attribute name="hticklabelsdrawn" type="boolean" value="false
"/>
<view name="backingrsc" width="${parent.width}" height="${parent.height}" stretches="both" visible="${(parent.parent.bgresource != null ? true : false)}">
<handler name="oninit">
if(parent.parent.bgresource){
this.setSource(parent.parent.bgresource);
}
</handler>
</view>
<view name="htickclip" height="${parent.height + 10}" x="${-(this.width)}" y="-5" width="${parent.parent.plotx}" clip="true">
<view name="htickpane" width="${parent.width}" height="${classroot.parent.dataclip.datapane.height}" x="0" y="${classroot.parent.dataclip.datapane.y + 5}">
<method name="breakDown">
var killviews = 0;
for(var i = 0; i <= this.subviews.length; i++){
if(this.subviews[i] instanceof lz.ticklabel){
killviews++;
}
}
var remainviews = this.subviews.length - killviews;
while(this.subviews.length != remainviews){
for(var j = 0; j <= this.subviews.length; j++){
if(this.subviews[j] instanceof lz.ticklabel){
this.subviews[j].destroy();
}
}
}
</method>
</view>
<drawview name="htickdrawer" width="${parent.width}" height="${parent.height}" y="${parent.htickpane.y}">
<attribute name="drawready" type="boolean" value="false
"/>
<handler name="oncontext">
this.setAttribute('drawready', true);
</handler>
</drawview>
</view>
<view name="vtickclip" width="${parent.width + 20}" clip="true" x="-5" height="${parent.height + (parent.parent.height - (parent.parent.plotheight + parent.parent.ploty))}">
<view name="vtickpane" width="${classroot.parent.dataclip.datapane.width}" height="${parent.height}" x="${classroot.parent.dataclip.datapane.x + 5}" y="0">
<method name="breakDown">
var killviews = 0;
for(var i = 0; i <= this.subviews.length; i++){
if(this.subviews[i] instanceof lz.ticklabel){
killviews++;
}
}
var remainviews = this.subviews.length - killviews;
while(this.subviews.length != remainviews){
for(var j = 0; j <= this.subviews.length; j++){
if(this.subviews[j] instanceof lz.ticklabel){
this.subviews[j].destroy();
}
}
}
</method>
</view>
<drawview name="vtickdrawer" width="${parent.width}" height="${parent.height}" x="${parent.vtickpane.x}">
<attribute name="drawready" type="boolean" value="false
"/>
<handler name="oncontext">
this.setAttribute('drawready', true);
</handler>
</drawview>
</view>
<drawview name="borderdrawer" width="${parent.width}" height="${parent.height}">
<attribute name="drawready" type="boolean" value="false
"/>
<handler name="oncontext">
this.setAttribute('drawready', true);
</handler>
</drawview>
<method name="clearAll">
this.clearGrid();
this.clearHTickLabels();
this.clearVTickLabels();
</method>
<method name="clearGrid">
if(this.bgridclip.backinggrid.drawready){
this.bgridclip.backinggrid.clear();
}
if(this.bgridclip.zerodrawer.drawready){
this.bgridclip.zerodrawer.clear();
}
if(this.borderdrawer.drawready){
this.borderdrawer.clear();
}
if(this.htickclip.htickdrawer.drawready){
this.htickclip.htickdrawer.clear();
}
if(this.vtickclip.vtickdrawer.drawready){
this.vtickclip.vtickdrawer.clear();
}
this.setAttribute('vlinesdrawn', false);
this.setAttribute('vbandsdrawn', false);
this.setAttribute('hlinesdrawn', false);
this.setAttribute('hbandsdrawn', false);
this.setAttribute('hticksdrawn', false);
this.setAttribute('vticksdrawn', false);
this.setAttribute('belowzerodrawn', false);
this.setAttribute('zerodrawn', false);
</method>
<method name="clearVTickLabels">
this.vtickclip.vtickpane.breakDown();
this.setAttribute('vticklabelsdrawn', false);
</method>
<method name="clearHTickLabels">
this.htickclip.htickpane.breakDown();
this.setAttribute('hticklabelsdrawn', false);
</method>
<method name="renderAll">
this.renderGrid();
this.renderAltGrid();
</method>
<method name="renderGrid">
if(this.bgridclip.backinggrid.drawready == true){
if(parent.hgridbands){
this.renderHorizBands();
}
if(parent.hgridlines){
this.renderHorizLines();
}
}
if(this.htickclip.htickdrawer.drawready == true){
if(parent.htick){
this.renderHTicks();
}
}
if(parent.hticklabel){
this.renderHTickLabels();
}
if(this.borderdrawer.drawready == true){
if(parent.border){
this.renderBorder();
}
if(parent.vaxis != null){
this.renderVaxis();
}
if(parent.haxis != null){
this.renderHaxis();
}
}
</method>
<method name="renderRect" args="dv, tlx, tly, brx, bry, fillcolor, fillopacity">
// set styles to drawview
dv.fillStyle = fillcolor;
dv.globalAlpha = fillopacity;
// create rectangle path
dv.beginPath();
dv.moveTo(tlx,tly);
dv.lineTo(brx,tly);
dv.lineTo(brx,bry);
dv.lineTo(tlx,bry);
dv.lineTo(tlx,tly);
dv.fill();
</method>
<method name="renderBorder">
this.borderdrawer.globalAlpha = 1;
this.borderdrawer.strokeStyle = parent.border;
this.borderdrawer.lineWidth = parent.borderwidth;
this.borderdrawer.beginPath();
this.borderdrawer.moveTo(0, 0);
this.borderdrawer.lineTo(this.width, 0);
this.borderdrawer.lineTo(this.width, this.height);
this.borderdrawer.lineTo(0, this.height);
this.borderdrawer.lineTo(0, 0);
this.borderdrawer.stroke();
</method>
<doc>
<tag name="shortdesc">
<text>
(See barchart or linechart for an example.)
</text>
</tag>
</doc>
</class>
</library>
Cross References
Includes
Classes