barchartplotarea.lzx
<library>
<include href="../common/datalabel.lzx"/>
<class name="barchartplotarea" extends="virtualdrawview" x="0" y="0" width="${parent.width}" height="${parent.height}">
<viewspool name="_barspool" parentview="${parent}" viewclass="databar"/>
<viewspool name="_datalabelpool" parentview="${parent}" viewclass="datalabel"/>
<method name="renderSeries" args="xseries, yseries, tooltipseries, labelseries, style, offset, width">
var x = offset;
if(xseries != null){
for(var i = 0; i < xseries.length; i++)
{
var v = renderBar(i + offset, width, yseries[i], style );
if(tooltipseries != null)
v.tooltip = tooltipseries[i];
if ( parent.datalabelEnabled && labelseries != null){
if(labelseries[i] != "null" && labelseries[i] != null && labelseries[i] != ''){
var label = _datalabelpool.getView();
var lx = v.x + v.width + 5;
label.setAttribute('style', style.label);
label.render(labelseries[i]);
label.setAttribute('x', lx+label.width>this.width?this.width-label.width:lx );
label.setAttribute('y', v.y + v.height);
label.bringToFront();
}
}
}
}
</method>
<method name="renderBar" args="x, width, height, style">
var v = _barspool.getView();
v.setAttribute('visible', false);
v.setAttribute('x', this._xoffset);
v.setAttribute('y', x * this._yscale + this._yoffset);
v.setAttribute('width', height * this._xscale);
v.setAttribute('height', width * this._yscale);
v.style = style;
v.render();
v.setAttribute('visible', true);
return v;
</method>
<method name="clear">
super.clear();
_barspool.reclaimAll();
_datalabelpool.reclaimAll();
</method>
</class>
</library>
Cross References
Includes
Classes