columnchartplotarea.lzx
<library>
<include href="../common/datalabel.lzx"/>
<include href="../common/virtualdrawview.lzx"/>
<class name="columnchartplotarea" extends="virtualdrawview">
<viewspool name="_barspool" parentview="${parent}" viewclass="databar"/>
<viewlistmanager name="listmanager"/>
<method name="renderSeries" args="xseries, yseries, tooltipseries, labelseries, style, offset, width, seriesNum, type">
var x = offset;
var updatedNeeded = style.updateNeeded(this);
var labelList = listmanager.getList(this, "datalabel", seriesNum);
for(var i = 0; i < xseries.length; i++)
{
var barX;
if( type.toUpperCase() == "LINEAR" ) {
barX = xseries[i];
} else {
barX = i;
}
var v = renderBar(barX + 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 = labelList.getViewAt(i);
if(updatedNeeded)
{
label.setAttribute('style', style.label);
label.render(labelseries[i]);
}
label.bringToFront();
//var ly = v.y + v.height - 25;
var ly = v.y - 25;
//var lx = v.x - label.width/2 + v.width/2;
var lx = (v.width - label.width)/2 + v.x + 3;
label.setAttribute('x', lx+label.width>this.width?this.width-label.width:lx<0?2:lx-5);
label.setAttribute('y', ly<this.y?2:ly);
label.setAttribute('visible', v.x>0 && v.x <this.width )
}
}
}
if(updatedNeeded)
{
style.markUpdated(this);
}
</method>
<method name="renderBar" args="x, width, height, style">
var v = _barspool.getView();
v.setAttribute('visible', false);
v.setAttribute('x', x * this._xscale + this._xoffset);
//v.setAttribute('y', this._yoffset);
v.setAttribute('y', this._yoffset-(height*this._yscale*-1));
v.setAttribute('width', width * this._xscale);
v.setAttribute('height', (height * this._yscale*-1));
v.style = style;
v.render()
v.setAttribute('visible', true);
return v;
</method>
<method name="clear">
super.clear();
_barspool.reclaimAll();
listmanager.reclaimAll();
</method>
</class>
</library>
Cross References
Includes
Classes